Skip to content

Instantly share code, notes, and snippets.

@alecklandgraf
Created August 25, 2016 22:55
Show Gist options
  • Save alecklandgraf/6318813b58c87a0d6a364b7ddc41b444 to your computer and use it in GitHub Desktop.
Save alecklandgraf/6318813b58c87a0d6a364b7ddc41b444 to your computer and use it in GitHub Desktop.
Angular Component starter app
// -- 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