Skip to content
This repository has been archived by the owner on Sep 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request #4 from OperationCode/jjh/ngModule-fix
Browse files Browse the repository at this point in the history
Register demo components on angular app module
  • Loading branch information
sethbergman authored Apr 1, 2017
2 parents 938ff7f + 7e40e9b commit 01ae14f
Show file tree
Hide file tree
Showing 46 changed files with 142 additions and 98,163 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ config
.env.sh
.env.js
env

# Webpack output
public/*.js
7 changes: 7 additions & 0 deletions app/angular-app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import routes from './modules/routes'
import demo from './modules/demo'

const ngModule = angular.module('app', ['app.routes', 'app.demo'])
.run (() => {
console.log('App is running!')
})
18 changes: 0 additions & 18 deletions app/components/angular-app.js

This file was deleted.

6 changes: 0 additions & 6 deletions app/components/common/auto-save/index.js

This file was deleted.

12 changes: 0 additions & 12 deletions app/components/demo/index.js

This file was deleted.

9 changes: 0 additions & 9 deletions app/components/index.js

This file was deleted.

12 changes: 0 additions & 12 deletions app/components/ng-deps.js

This file was deleted.

168 changes: 0 additions & 168 deletions app/components/routes.js

This file was deleted.

13 changes: 3 additions & 10 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="description" content="A dashboard built with the MEAN stack">
<link rel="icon" href="img/logo.svg">
<link href="/css/angular-material.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<base href="/">
</head>
<body ng-app="app">

<center><h1>Loading...</h1></center>
<favorite-teams></favorite-teams>
<script src="/js/angular.js"></script>
<script src="/js/angular-animate.js"></script>
<script src="/js/angular-aria.js"></script>
<script src="/js/angular-material.js"></script>

<script src="bundle.js"></script>
<div ng-view></div>
<script src="vendor.bundle.js"></script>
<script src="app.bundle.js"></script>
</body>
</html>
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions app/modules/common/auto-save/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import AutoSaveFormDirective from './directives/auto-save-form.directive';
import AutoSaveItemDirective from './directives/auto-save-item.directive';

angular.module('app.autoSave', [])
.directive('AutoSaveForm', AutoSaveFormDirective)
.directive('AutoSaveItem', AutoSaveItemDirective);
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import UserService from './services/user.service'
import UserModel from './models/user.model'
import autoSave from './auto-save'

let CommonModule = angular.module('appCommon', [])
let CommonModule = angular.module('app.common', [])
.component('UserService', UserService)
.component('UserModel', UserModel)
.directive('AutoSaveItem', AutoSaveItem)
.directive('AutoSaveForm', AutoSaveForm)

export default CommonModule
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ class BaseballTeamController {
$onInit() {
this.$logService.info('This component displays the baseball team entered');
}

}

const BaseballTeam = {
export default {
bindings: {
team: '='
},
template: '<div>{{$ctrl.team}}</div>',
template: '<div>Baseball Team: {{$ctrl.team}}</div>',
controller: BaseballTeamController
}

export default ngModule => {
ngModule.component('baseballTeam', BaseballTeam);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ class BasketballTeamController {
$onInit() {
this.$logService.info('This component displays the basketball team entered');
}

}

const BasketballTeam = {
export default {
bindings: {
team: '='
},
template: '<div>{{$ctrl.team}}</div>',
template: '<div>Basketball Team: {{$ctrl.team}}</div>',
controller: BasketballTeamController
}

export default ngModule => {
ngModule.component('basketballTeam', BasketballTeam);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<form class="favorite-teams">
<div class="favorite-teams">
<h2>Component Demo for Two-Way Binding btw/ Inputs & Controller</h2>

{{$ctrl.greeting}}

<div class="favoriteTeams-input">Football Team <input ng-model="$ctrl.footballTeam"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ class FavoriteTeamsController {
}
}

const FavoriteTeams = {
export default {
bindings: {},
template: require('./favorite-teams.html'), // could also inline it, just trying this out
template: require('./favorite-teams.html'),
controller: FavoriteTeamsController
}

export default ngModule => {
ngModule.component('favoriteTeams', FavoriteTeams);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ class FootballTeamController {
$onInit() {
this.$logService.info('This component displays the football team entered');
}

}

const FootballTeam = {
export default {
bindings: {
team: '='
},
template: '<div>{{$ctrl.team}}</div>',
template: '<div> Football Team: {{$ctrl.team}}</div>',
controller: FootballTeamController
}

export default ngModule => {
ngModule.component('footballTeam', FootballTeam);
}
}
10 changes: 10 additions & 0 deletions app/modules/demo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import favoriteTeams from './components/favorite-teams';
import footballTeam from './components/football-team';
import basketballTeam from './components/basketball-team';
import baseballTeam from './components/baseball-team';

export default angular.module('app.demo', [])
.component('favoriteTeams', favoriteTeams)
.component('footballTeam', footballTeam)
.component('basketballTeam', basketballTeam)
.component('baseballTeam', baseballTeam);
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file.
Loading

0 comments on commit 01ae14f

Please sign in to comment.