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' });
Comments
Post a Comment