jackjohnson44
asked on
angularjs can you use a templateurl for a controller?
I am trying to use Angularjs with a current SharePoint site so my architecture might be a little unorthodox. I want to be able to specify a template url in my controller. Basically I want to be able to mimic the route functionality of specifying a controller and view without actually using routing.
I can do something like
<div ng-controller="mycontoller ">This is my markup {{Name}}</div>
I want the markup to go in another file.
If I was using routing I could do it like below, but without routing:
$routeProvider
.when('/mycontoller', {
templateUrl: '/templatesangular/myconto ller.html' ,
controller: 'mycontoller'
})
I can do something like
<div ng-controller="mycontoller
I want the markup to go in another file.
If I was using routing I could do it like below, but without routing:
$routeProvider
.when('/mycontoller', {
templateUrl: '/templatesangular/myconto
controller: 'mycontoller'
})
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER