You must create a variable to receive the values within the component. Here's an example:
@Component({
selector: 'app-button',
template: '
<button type="submit">{{label}}</button>
',
})
export class AppButtonComponent {
@Input() label: string;
}
This will cause you to declare the label
variable at the time you create the component, like this:
<app-button [label]="'Teste'"></app-button>
Note that I declared the name "Test" inside single quotation marks because I am declaring it manually. If it were another variable within your other component, you could pass the variable directly, without the need for quotation marks, like this:
<app-button [label]="minhaVariavel"></app-button>
Note : You can not declare anything inside the app-button
statement because when rendering, Angular will replace what you declared manually by what was declared in the template
or co_de property %.