Monday, September 22, 2014

AngularJS ui-router and ngTemplate

Using ui-router with templates in an AngularJS application. If I do this then the ng-view does not work unless either the ng-view is in top level HTML (or at least that's how it appears), or I call app.run and inject $state. So, I have something like
<div ng-app="app">
    <div>
        <div data-ng-include="'/app/layout/shell.html'"></div>
    </div>
</div>
and then in shell.html
    
<section id="content" class="main">
        <div ui-view></div>
</section>
This doesn't work unless I call
app.run($scope){}
However this:
<div ng-app="app">
    <div>
       <div ui-view></div>
    </div>
</div>
does.

No comments: