This file contains hidden or 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
import angular from 'angular'; | |
import Home from './home/home.component'; | |
export default angular | |
.module('app.components', []) | |
.component('home', Home) | |
.config(($stateProvider, $urlRouterProvider) => { | |
'ngInject'; | |
$stateProvider | |
.state('home', { url: '/', component: 'home' }); |
This file contains hidden or 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
import template from './home.html'; | |
class HomeController { | |
constructor() { | |
this.title = 'Hello from AngularJS'; | |
} | |
} | |
export default { | |
template, |
This file contains hidden or 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
import angular from 'angular'; | |
import NavbarComponent from './navbar/navbar.component'; | |
export default angular | |
.module('app.common', []) | |
.component('navbar', NavbarComponent); |
This file contains hidden or 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
import 'babel-polyfill'; | |
import angular from 'angular'; | |
import CommonModule from './common/common.module'; | |
import ComponentModule from './components/components.module'; | |
angular.module('app', [ | |
'ui.router', | |
'app.common', | |
'app.components', | |
]); |
This file contains hidden or 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
import angular from 'angular'; | |
import NavbarComponent from './navbar/navbar.component'; | |
export default angular | |
.module('app.common', []) | |
.directive('navbar', () => NavbarComponent); |
This file contains hidden or 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
import angular from 'angular'; | |
import HomeComponent from './home/home.component'; | |
import homeTemplate from './home/home.html'; | |
export default angular | |
.module('app.components', []) | |
.controller('HomeComponent', HomeComponent) | |
.config(($stateProvider, $urlRouterProvider) => { | |
'ngInject'; | |
$stateProvider |
This file contains hidden or 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
export default class HomeComponent { | |
constructor() { | |
this.title = 'Hello from AngularJS'; | |
} | |
} |
This file contains hidden or 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
├── app/ | |
│ ├── components/ | |
│ │ ├── home/ | |
│ │ │ ├── home.component.js | |
│ │ │ ├── home.html | |
│ │ └── components.module.js | |
│ ├── common/ | |
│ │ ├── navbar/ | |
│ │ │ ├── navbar.component.js | |
│ │ │ ├── navbar.html |
This file contains hidden or 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<title>AngularJS</title> | |
</head> | |
<body ng-app="app"> | |
<section navbar></section> | |
<section ui-view></section> |