//TypeScript
/// <reference path="typings/angular2/angular2.d.ts" />
import {Component, View, bootstrap, NgFor, NgIf} from 'angular2/angular2';
@Component({
    selector: 'todo-list'
})
@View({
    templateUrl: "uiTemplate.html",
    directives: [NgFor, NgIf]
})
class TodoList {

    todos: Array<string>;

    constructor() {
        this.todos = ["Implement MVC", "Employee Content Refactor", 
"Explore WebGL","Explore Web frameworks"];
    }
    addTodo(todo: string) {
        this.todos.push(todo);
    }
    doneTyping($event) {
        if ($event.which === 13) {
            this.addTodo($event.target.value);
            $event.target.value = null;
        }
    }
}
bootstrap(TodoList);


On Wednesday, August 26, 2015 at 2:01:12 PM UTC+5:30, Senthil Kumaran 
Chinnathambi wrote:
>
> If I add components like below ,
>
> <todo-list> </todo-list>
> <todo-list> </todo-list>
>
> I can able to see only the first todo-list.
>
> Second todo-list is not visible .  Its width and height set to zero.
>
> How to add multiple same kind of Components?
>

-- 
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