0

Sometimes i'm struggling to understand the angular scope, and its inheritance, and today seems to be one of those days...

Basically i just want to disable a button when its pressed, im using ng-click and ng-disable for this. Is there some other method that needs to be used for this kind of function? The ng-docs uses a value that is bound to the ng-disabled, but in my case i would want to simply use one element only.

Heres the Plunkr

1 Answer 1

2

Inside your ng-disabled, you're already writing in Angular, so remove the {{}} and just make it isdisabled. Be sure to toggle that in your function then.

Plunkr: http://plnkr.co/edit/CGzvFjLfkvPV2cuOfb2g?p=preview

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, that did the trick! Could you further elaborate why theres no need for the curly-braces? Is it because of the ng-disabled directive?
ng-* are angular directives, therefore when writing inside them, you're already writing in Angular, no need to use the {{}}. Hence your ng-click='function() isn't ng-click="{{function()}}"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.