Pass variable to custom component
20:24 16 Feb 2017

I have my custom component:

@Component({
    selector: 'my-custom-component',
    templateUrl: './my-custom-component.html',
    styleUrls: ['./my-custom-component.css']
})
export class MyCustomComponent {
    constructor() {
        console.log('myCustomComponent');
    }
}

I can use it like this:


But how I can pass a variable? For example:


And use this in my component code?

angular typescript angular2-template angular2-components