I'm new to Angular and looked around but couldn't find the answer...
How do you pass a parameter to a component (html) that is using @Input ?
What I'm trying to achieve is quite simple, I have a LogoComponent which I'd like to call from 2 places: the LoginComponent (there it should be full size) and from the DashboardComponent (where its size is parametrized) but I'm getting an exception:
Uncaught Error: Template parse errors: Can't bind to 'size' since it isn't a known property of 's-logo'. 1. If 's-logo' is an Angular component and it has 'size' input, then verify that it is part of this module.
logo.component.ts (simplified for the sake of lisibility)
@Component({
selector: 's-logo',
template: `<div>{{size}}</div>`, <----- size would actually set the css height
})
export class LogoComponent{
@Input() size: string ;
}
login.component.html (simplified)
<s-logo [size]="100px"></s-logo>
I also tried with the syntax, with no luck (double + single quotes):
<s-logo [size]="'100px'"></s-logo>
Isn't that how I'm supposed to achieve this ?
Input, but there is noheightanywhere. I suspect somewhere you do like<s-logo [height]="100px"></s-logo>@NgModuledeclarations array?