index.html:
<app [myname]="some_name"></app>
app.component.ts:
import {Component, Input, Output} from '@angular/core';
@Component({
selector: 'app',
template: '<span>{{myname}}</span>'
})
export class CupBuyComponent {
@Input() myname: String;
constructor(){
console.log(this.myname);
}
}
JS console says undefined. How can I get variables from .html file to send it to component?