marklagendijk / ui-router.stateHelper

A helper module for AngularUI Router, which allows you to define your states as an object tree.
MIT License
235 stars 40 forks source link

Is it possible use ng-template? #27

Closed rochapablo closed 8 years ago

rochapablo commented 8 years ago

I'm trying use ng-template, but nothing happens, not even an error.

Here's what I'm doing:

app.config(function($urlRouterProvider, stateHelperProvider) {
  stateHelperProvider.state({
    name: 'private',        
    templateUrl: 'private.html',
    children: [
      {
        name: 'dashboard',
        url: '/',
        templateUrl: 'dashboard.html',
        controller: 'DashboardCtrl'
      }
    ]
  });
});
<main ng-app="App" layout="row">
    <div ui-view></div>
</main>
<script type="text/ng-template" id="private.html">
   <div>#private</div>
   <div ui-view></div>
</script>
<script type="text/ng-template" id="dashboard.html">
 <div>#dashboard</div>
</script>

What am I missing?

rochapablo commented 8 years ago

I've just changed my script tag, putting it inside the ng-app.