Created
August 25, 2016 22:55
-
-
Save alecklandgraf/6318813b58c87a0d6a364b7ddc41b444 to your computer and use it in GitHub Desktop.
Angular Component starter app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -- in app.component.js -- | |
import angular from 'angular'; | |
const AppComponent = { | |
template: ` | |
<app-header></app-header> | |
<app-nav></app-nav> | |
<div> | |
<div ui-view></div> | |
</div> | |
<app-footer></app-footer> | |
` | |
}; | |
const appComponentModule = angular | |
.module('appComponentModule', []) | |
.component('app', AppComponent); | |
export default appComponentModule.name; | |
// -- in app.js -- | |
import angular from 'angular'; | |
import uiRouter from 'angular-ui-router'; | |
import Components from './components'; | |
import AppComponent from './app.component'; | |
const App = angular.module('app', [ | |
uiRouter, | |
Components, | |
AppComponent | |
]); | |
angular.bootstrap(document.querySelector('[data-app]'), [App]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment