Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF in JavaScript
Message
From
05/08/2014 13:58:46
 
General information
Forum:
Javascript
Category:
Other
Miscellaneous
Thread ID:
01605133
Message ID:
01605189
Views:
25
>>>ng-disabled = "variableInScope" and it would work correctly.
>>
>>I'd guess it's because the string always casts to Boolean true (as in previous post re: ternary operator). It's certainly not binding to the scope variable.
>>
>
>I think it does work correctly and bind to the variable. The ng-show clearly binds to the variable.
>
>Anyway, I tried this code
>
>
> <data-confirm:button class="btn btn-default" confirm-title="Confirm Clear"
>                                     confirm-message="'Are you sure you want to clear all e-messages?'"
>                                     ok-label="Yes"
>                                     cancel-label="No"
>                                     link-text="Clear E-Messages"
>                                     disable-action ="{{ disableClearMessage }}"
>                                     ok-action="clearEMessage()"></data-confirm:button>
>
>
>and got this error after I opened Google Chrome Developer's tools:
>
>Error: [$parse:syntax] Syntax Error: Token 'disableClearMessage' is unexpected, expecting [:] at column 4 of the expression [{{ disableClearMessage }}] starting at [disableClearMessage }}].
>
>So, it doesn't work here this way.

So I'm assuming you have '$scope.disableClearMessage = true; ' in the controller.
Works for me.
Try 'disable-action="{{disableClearMessage}}"' and 'disable-action="disableClearMessage"' in the markup and inspect the button in the browser for each case.
The first should show 'true' (which is what you want) and the second show 'disableClearMessage' (which is obviously useless)


>
>>>So, how should I adjust my template? Should I go back to
>>>
>>>ng-disabled = "disableAction" ?
>>
>>No. I think you should back up and make sure you understand scope bindings :-}
>>
>>>BTW, by controller I mean the controller.js file, not the .cs controller.
>>
>>I know.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform