-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rearchitected angular and react examples
- Loading branch information
1 parent
3da1c70
commit d3e26b0
Showing
44 changed files
with
610 additions
and
142 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import angular from 'angular' | ||
// import template from '../templates/app.html' | ||
import banner from './banner' | ||
import footer from './footer' | ||
|
||
class AppCtrl { | ||
constructor() { | ||
this.url = 'https://github.com/preboot/angular-webpack' | ||
} | ||
} | ||
|
||
export default angular.module('appComponent', [banner.name, footer.name]) | ||
.component('app', { | ||
template: ` | ||
<main> | ||
<banner></banner> | ||
<img src="/img/logo.png"> | ||
</main> | ||
<app-footer url="app.url"></app-footer> | ||
`, | ||
controller: AppCtrl, | ||
controllerAs: '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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
import angular from 'angular' | ||
import template from '../templates/app.html' | ||
import AppCtrl from '../controllers/app' | ||
import banner from './banner' | ||
import footer from './footer' | ||
|
||
export default { | ||
template, | ||
controller: AppCtrl, | ||
controllerAs: 'app' | ||
class AppCtrl { | ||
constructor() { | ||
this.url = 'https://github.com/preboot/angular-webpack' | ||
} | ||
} | ||
|
||
export default angular.module('appComponent', [banner.name, footer.name]) | ||
.component('app', { | ||
template, | ||
controller: AppCtrl, | ||
controllerAs: '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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
import angular from 'angular' | ||
import template from '../templates/banner.html' | ||
import BannerCtrl from '../controllers/banner' | ||
import messageService from '../services/messages' | ||
|
||
export default { | ||
template, | ||
controller: BannerCtrl, | ||
controllerAs: 'banner' | ||
class BannerCtrl { | ||
constructor(messages) { | ||
this.message = '' | ||
this.buttonText = 'Update message' | ||
this.messages = messages | ||
this.updateMessage() | ||
} | ||
|
||
updateMessage() { | ||
this.message = this.messages.get() | ||
} | ||
} | ||
|
||
export default angular.module('bannerComponent', [messageService.name]) | ||
.component('banner', { | ||
template, | ||
controller: BannerCtrl, | ||
controllerAs: 'banner' | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import template from '../templates/footer.html' | ||
|
||
export default { | ||
template, | ||
bindings: { | ||
url: '<' | ||
} | ||
} | ||
export default angular.module('footerComponent', []) | ||
.component('appFooter', { | ||
template, | ||
bindings: { | ||
url: '<' | ||
} | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.