Link to home
Start Free TrialLog in
Avatar of jackjohnson44
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/mycontoller.html',
            controller: 'mycontoller'
        })
ASKER CERTIFIED SOLUTION
Avatar of Kyle Hamilton
Kyle Hamilton
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jackjohnson44
jackjohnson44

ASKER

Thanks!  I had that but apparently my jQuery version was old.