Hi,

"class" and couple of other attributes are special-cased in the
compiler to improve user ergonomics. You can find the complete list of
special cases here:
https://github.com/angular/angular/blob/1cf5f5fa38ea672a972313049c9de2db6024441d/modules/%40angular/compiler/src/schema/dom_element_schema_registry.ts#L230-L236

Cheers,
Pawel

On Mon, Oct 3, 2016 at 4:56 PM, Jónatan Núñez <[email protected]> wrote:
> Hi,
>
> I was reading the angular 2 guide and I have a question with class binding
>
> https://angular.io/docs/ts/latest/guide/template-syntax.html#!#class-binding
>
> <!-- reset/override all class names with a binding  -->
> <div class="bad curly special"
>      [class]="badCurly">Bad curly</div>
>
> Why we can bind the attribute "class"?
>
> The guide tell us that we can bind the DOM properties, but not the HTML
> attributes:
>
> https://angular.io/docs/ts/latest/guide/template-syntax.html#!#html-attribute-vs-dom-property
>
> So, why [class] works? Should it be [className]?
>
> Why angular doesn't throw an exception like colspan?
>
>> Template parse errors:
>> Can't bind to 'colspan' since it isn't a known native property
>
> --
> 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 https://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.



-- 
AngularJS book:
http://www.packtpub.com/angularjs-web-application-development/book
Looking for bootstrap-based widget library for AngularJS?
http://angular-ui.github.com/bootstrap/

-- 
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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to