Are you using the @Input decorator correctly?
I use it in my components in this format:
@Input() person:string;
On Monday, January 18, 2016 at 1:43:57 PM UTC-5, Cagatay Civici wrote:
>
> Hi,
>
> When writing a custom attribute directive, if I create a property name
> that overlaps with the property-attribute name of the html element, does
> anyone know if I can override it with no side effects? For example;
>
> import {Directive, ElementRef, OnInit, OnDestroy,
> HostBinding,Input,OnChanges,SimpleChange} from 'angular2/core';
>
> @Directive({
> selector: '[pSpinner]'
> })
> export class SpinnerDirective implements OnInit, OnDestroy, OnChanges {
>
> @Input('disabled') disabled;
>
> constructor(private el: ElementRef) {}
>
> }
>
> Usage is like;
>
> <input type="text" [disabled]="disabledValueAtComponent" />
>
> So setting disabledValueAtComponent = true does not disable the input, so
> it seems like my disabled property at directive is overriding a regular
> attribute binding to an html element right?
>
> Thank you,
>
> Cagatay
>
--
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.