Hello, I spent the afternoon learning about optional attributes and I got a
couple of questions I wasn't able to deduce by logic.
To be honest, most of my study is based in angular-ui bootstrap.
Let's begin.
Is there any good difference of putting an optional parameter in the
"scope: {}" ?
See
this:
https://github.com/angular-ui/bootstrap/blob/master/src/pagination/pagination.js#L85-L89
As you can see there, there are 3 properties in "scope: {}" bu that
directive accepts more attributes. *Why are those attributes outside? Just
for being optionals?*
Some people tells me that I should put all the directive interface in
"scope: {}" to take advantage of $compile but ui-bootstrap doesn't do it.
That confuses me.
On the other hand, I see some option attribute accepting interpolate values
and other doesn't,
example:
https://github.com/angular-ui/bootstrap/blob/master/src/pagination/pagination.js#L85-L89
I can do a:
first-text="{{foo}}"
or
first-text="just-text"
but
first-text="foo"
will be treated as a string.
I understand the code of course, what I ask here is: *when should my
optional attribute be able to interpolate values as first-text here, or
when it shouldn't? (like rotate in that link).*
The relation I see is that the ones that can be interpolated are just text
and the other are booleans.
My first guess is: interpolate when those attributes are template stuff and
not to interpolate when they are not for the template. I mean, firstText is
something that will appear in the final template but rotate modifies the
structure but won't appear in the template per se.
Extra question :P
In what use case a: model: "=?" could be useful?
Thank you.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.