This is my start page, it is rendered on the backend (instead of 'propval'
there will be a variable containing the json-configuration):
<%- include('template/head'); %>
<application [userdata]='"propval"'>
Loading...
</application>
<%- include('template/foot'); %>
This is my component that handles the 'application' selector:
@Component({
moduleId: module.id,
selector: 'application',
templateUrl: './app.component.html',
providers:[
ProgressBar
]
})
export class AppComponent implements OnInit {
public userdata;
constructor(public progressBar :ProgressBar, private router: Router) {
console.log("constructor",this.userdata);
}
public async ngOnInit() {
console.log("ngOnInit",this.userdata);
}
}
As a result, in the console I get:
constructor undefined
ngOnInit undefined
How to read userdata
property? Perhaps this is not will done in AppComponent
, since application
selector is not rendered inside the app.component.html
. application
selector rendered on the backend.