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

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -