In the examples I found for Angular 2, components can be created once for each application as such:
(function(app) {
app.AppComponent =
ng.core.Component({
selector: 'my-app',
template: '<h1>My First Angular 2 App</h1>'
})
.Class({
constructor: function() {}
});
})(window.app || (window.app = {}));
with loading the app / main.js component:
(function(app) {
document.addEventListener('DOMContentLoaded', function() {
ng.platform.browser.bootstrap(app.AppComponent);
});
})(window.app || (window.app = {}));
But how can I identify a reusable component? The documentation is submitted in Typescript format or for Angular 1.
source
share