javascript - AngularJS including partial template -


i'm using angularjs ui router code

.state('posts', {                 url: '/posts/{id}',                 templateurl: '/javascripts/templates/posts.ejs',                 controller: 'postsctrl',                 resolve: {                   post: ['$stateparams', 'posts', function($stateparams, posts) {                     console.log("post: ", posts.get($stateparams.id));                     return posts.get($stateparams.id);                   }]                 }             }) 

and script inclusion

<body ng-app="..."> <div> <ui-view></ui-view> </div> ....  <script type="text/ng-template" id="/javascripts/templates/posts.ejs" src="/javascripts/templates/posts.ejs"> 

this ejs(html) file itself

<div class="page-header">         ....   </div> 

however, cannot source holds ejs file load. when go correct url /posts/{id}, no ejs (html) loads , there no console errors. idea how load ejs file /javascripts/templates/posts.ejs instead of writing inline? inline code :(

thanks!


Popular posts from this blog