Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF in JavaScript
Message
De
05/08/2014 13:41:01
 
 
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01605133
Message ID:
01605187
Vues:
28
>>>>Don't get it. 'disable-action="disableClearMessage" ' is setting the value to a string. How does it get to a bool ?
>>>>
>>>>
>>>>>
>>>>>However, the button is not disabled and I can click on it just fine and the click event works. It may be a minor problem since the only reason I want to disable the button if there is nothing to clear (the message is empty anyway).
>>>
>>>disableClearMessage is a variable I define in the controller's code. So, I set it to true or false in the code.
>>
>>You mean it is in the controller scope? As before you are assigning a string - you need to reference it in the scope:
disable-action="{{disableClearMessage}}"
>>
>Let me try that.
>
>I still don't understand why we can set
>
>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.

>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform