On Thursday, December 18, 2014 8:58:19 AM UTC+5:30, Hiran Gankanda wrote:
>
> My MVC webpage has two links for "*Dashboard*" and "*ManageClient*"
> pages. When I directly set route path to my AngularJS page(ManageClient),
> my "new client" template shows in <div ng-view="">perfectly.
>
> routes.MapRoute(
> name: "Default",
> url: "{controller}/{action}/{id}",
> defaults: new { controller = "SubMClientManagement", action =
> "ManageClient", id = UrlParameter.Optional });
> >>>> link in browser : http://localhost:55542/#/newClient
>
>
> *BUT;*
> If I set it to Dashboard, and go to ManageClient page and click newClient
> button it will not work
>
> routes.MapRoute(
> name: "Default",
> url: "{controller}/{action}/{id}",
> defaults: new { controller = "SubMClientManagement", action =
> "Dashboard", id = UrlParameter.Optional },
> //defaults: new { controller = "SubMClientManagement", action =
> "ManageClient", id = UrlParameter.Optional });
> >>>> link in browser :
> >>>> http://localhost:55542/SubMClientManagement/ManageClient/#/newClient
>
>
> FYI
>
> ang. route config :
>
> ClientMngModel.config(['$routeProvider', '$locationProvider', function
> ($routeProvider, $locationProvider) {
> //$locationProvider.html5Mode(true);
>
> $routeProvider
> .when("/newClient", {
> controller: "NewClientController",
> templateUrl: "Templates/ClientMngTemp/NewClient.html"
> })
> .when("/deleteClient", {
> controller: "DeleteClientController",
> templateUrl: "Templates/ClientMngTemp/DeleteClient.html"
> })
> .when("/updateClient", {
> controller: "EditClientController",
> templateUrl: "Templates/ClientMngTemp/UpdateClient.html"
> })
> .otherwise({ redirectTo: "/" });}]);
>
> In View : SubMClientManagement/ManageClient.cshtml
>
> <a href="#/newClient" class="btn btn-info btn-circle btn-lg"><i class="fa
> fa-plus"></i></a>
>
>
> *Versions : angularjs.1.2.27 | Mvc 4.0*
>
>
> ****Really appreciate your help :-)*
>
Solution : templateUrl: "*../../*Templates/ClientMngTemp/NewClient.html"
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.