angularjs - ui-router with ControllerAs binding -


ui-router state:

$stateprovider     .state('dashboard', {         url: '/dashboard',         templateurl: 'app/dashboard/dashboard.html',         controller: 'dashboardcontroller vm'     }); 

in dashboardcontroller have:

var vm = this; vm.title = 'dashboard'; 

and in dashboard.html template:

{{vm.title}} 

why result showing "{{vm.title}}" instead of bind it's value in controller?

there's controlleras setting when configure state.

$stateprovider     .state('dashboard', {         url: '/dashboard',         templateurl: 'app/dashboard/dashboard.html',         controller: 'dashboardcontroller',         controlleras: 'vm'     }); 

https://github.com/angular-ui/ui-router/wiki


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -