I'm using Angular 2 Alpha 35 with TypeScript. On Google one can find lots 
of examples of using a property:

http://blog.thoughtram.io/angular/2015/03/27/building-a-zippy-component-in-angular-2.html

Problem is, these examples don't work for me. 

My HTML:

<multiselect [mytext]="'Venus'"></multiselect>

and from multiselect.ts:

@Component({
    selector: 'multiselect',     // Use <multiselect></multiselect> tags in 
HTML to use
    properties: ['mytext']
})
@View({
    templateUrl: '/directives/multiselect.html',
    directives: [NgFor]
})

export class Multiselect        // export = make it visible outside this 
module
{
    constructor() {
        console.log( this.mytext );
    }
...


I get this error in the Visual Studio editor (from typescript):

any
Property 'mytext' does not exist on type 'Multiselect'

If I add it as a variable to the class, it is non-initialized, instead of 
containing the string 'Venus'. Any idea why?

Where can I read official documentation on Properties and Attributes?

Also, is there a template Plunkr for Angular 2, so when asking questions in 
the future, I can easily modify it to ask questions?

-Vern

-- 
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/d/optout.

Reply via email to