A
A
Abc Edc2015-05-31 08:37:58
Angular
Abc Edc, 2015-05-31 08:37:58

Why doesn't ng show work with controller as?

.state('user', {
                url: '/user',
                controller: 'Profile',
                controllerAs: 'vm',
                templateUrl: 'app/user/templates/profile.html'
            });

function Profile ($scope) {
        var vm = this;
        vm.securityCheked = true;}

<div class="profile-security" ng-show="vm.securityCheked">
................

It only works if you change the VM to the osprey, but it doesn’t. Why is it so?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Tartmin, 2015-05-31
@baskerville42

you are not attentive
change to:
When you write vm as Profile, use vm.bla-bla-bla in templates

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question