I have an outer component with a property:
Loading: Boolean = false;
this outer component is setting this property on a nested component:
<etp-loader text="loading..." loading="{{Loading}}"></etp-loader>
when I do typeof(this.Loading) on the nested component, I get string, which [what i believe] is what throws off the whole logic.
here's my nested component:
import { Component, AfterViewInit, OnInit, Input} from '@angular/core'
@Component({
selector: 'etp-loader',
template: `<div *ngIf="loading" class="progress" style="margin-left: 10%; margin-right: 10%;">
<div class="progress-bar progress-bar-warning progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0"
aria-valuemax="100" style="width:100%;">
{{text}}
</div>
</div>`
})
export class EtpLoaderComponent {
@Input()
text: string;
@Input()
loading: Boolean;
ngOnInit() {
console.debug('init: loader state: ',
this.loading,
typeof(this.loading)); // => init: loader state: false string
}
}
edit - removed irrelevant bits