Quick question about ngAttr

337 views
Skip to first unread message

Fernando Gabrieli

unread,
Mar 20, 2014, 11:01:55 AM3/20/14
to ang...@googlegroups.com
Hi all, do you know what version of Angular supports the ngAttr directive? I am using v1.0.8

cheers
Fernando

Kamal

unread,
Mar 21, 2014, 5:22:53 AM3/21/14
to ang...@googlegroups.com
Fernando,

As far as the docs/code goes i don't see any directive with the specific name 'ngAttr' if you meant by the following attributes "ng-multiple,ng-selected,ng-checked,ng-disabled,ng-readonly,ng-required,ng-src,ng-href" (as per code are said as ngAttribute's) there are available in 1.0.8.

Regards,
Kamal

Fernando Gabrieli

unread,
Mar 21, 2014, 9:45:30 AM3/21/14
to ang...@googlegroups.com
Hi Kamal, thanks for replying, you mean using it like:

data-ng-attribute-style="background-color: red" ?

I tried it but it didn't work i might be doing something wrong

thanks
Fernando


--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/n5jNDE6wR2s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Lucas Galfaso

unread,
Mar 21, 2014, 3:24:07 PM3/21/14
to ang...@googlegroups.com
Hi,
  You can check how the ng-attr directive is used at http://docs.angularjs.org/guide/directive at the section named "ngAttr attribute bindings"

Note: it is not meant to be used for the `style` attribute, in that case use `ng-style`

-lg

Fernando Gabrieli

unread,
Mar 21, 2014, 3:36:55 PM3/21/14
to ang...@googlegroups.com
Thanks Lucas, but i think my angular version doesn't support it, 1.0.8, is this possible?

Also  i couldn't make ng-style accept adding "!important" to the rules, it just accepts the object with key, value, where can i put the "!important"?


Lucas Galfaso

unread,
Mar 21, 2014, 4:34:37 PM3/21/14
to ang...@googlegroups.com
Hi,
  Sorry, I thought that 1.0.8 did support for ng-attr-* directives, but it looks like that it not the case.
  "!important" is an attribute you can put in a css definition, everything you put at a `style` attribute overrides every css property for that element.

-lg

Fernando Gabrieli

unread,
Mar 21, 2014, 4:58:38 PM3/21/14
to ang...@googlegroups.com
I think if you set a class with !important it will have more specificity that an inline style, we should try it and see
Reply all
Reply to author
Forward
0 new messages