I want to pass variables from the including html page to the my app.
Note: I know how to pass between components but the question is from outside the app!
Example My html page:
<body>
<my-app customerId="123">Loading...</my-app>
</body>
and i want to be able to use "customerId" variable in my app.
import {Component} from 'angular2/core';
@Component({
selector: 'my-app',
template: '<h1>My First Angular 2 App</h1>'
})
export class AppComponent {
customerId;
}
How can this be done?
I tried with input but with no success.
@Input("customerId") customerId;
Thanks.