Issue
I stumbled across a minor difference and I couldn't figure out what the difference is, if there are any.
e.g:
<kendo-label class="k-display-block" [for]="list" [text]="'find user'"> </kendo-label>
and
<kendo-label class="k-display-block" [for]="list" text="Nutzer finden"> </kendo-label>
notice the double quotation marks in the first line of code.
Thanks a lot in advance
Solution
Angular uses property binding, wherin you can bind javascript expressions or properties/functions of a class to attributes and pass them to child component. You can identify the bindings by.
[test] <- property binding (one way binding - from ts updates the html)
(test) <- event binding (one way binding - from html updates the ts)
[(ngModel)] <- both bindings (two way binding - does both the actions of the above bindings)
So in the below expression text is expecting a javascript expression, without the quotes it cannot understand if its a string, it will just error out, trying to find
some property called find
eventhough its a string.
<kendo-label class="k-display-block" [for]="list" [text]="'find user'"> </kendo-label>
In the below code there is no binding, so by default it will passed as string and its pure html, no angular bindings involved!
<kendo-label class="k-display-block" [for]="list" text="Nutzer finden"> </kendo-label>
Answered By - Naren Murali
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.