File tree Expand file tree Collapse file tree 16 files changed +129
-44
lines changed
Expand file tree Collapse file tree 16 files changed +129
-44
lines changed Original file line number Diff line number Diff line change 1+ import Tools from './tools.service' ;
2+
3+ const ApiModule = 'app.api' ;
4+
5+ export default ApiModule ;
6+
7+ angular
8+ . module ( ApiModule , [ ] )
9+ . service ( 'Tools' , Tools ) ;
Original file line number Diff line number Diff line change 1+ const tools = [ {
2+ name : 'AngularJS' ,
3+ href : 'https://angularjs.org' ,
4+ image : 'https://raw.githubusercontent.com/angular/angular.js/master/images/logo/AngularJS.exports/AngularJS-medium.png'
5+ } , {
6+ name : 'webpack' ,
7+ href : 'https://webpack.js.org/' ,
8+ image : 'https://raw.githubusercontent.com/webpack/media/master/logo/icon.png'
9+ } , {
10+ name : 'ES2015+' ,
11+ href : 'https://devhints.io/es6' ,
12+ image : 'https://cdn-images-1.medium.com/max/785/1*j8TtXep5psnKxDEQeffPfg.png'
13+ } , {
14+ name : 'Babel' ,
15+ href : 'https://babeljs.io/' ,
16+ image : 'https://raw.githubusercontent.com/babel/logo/master/babel.png'
17+ } , {
18+ name : 'ESLint' ,
19+ href : 'https://eslint.org/' ,
20+ image : 'https://eslint.org/img/logo.svg'
21+ } , {
22+ name : 'Angular UI Router' ,
23+ href : 'https://ui-router.github.io/' ,
24+ image : 'https://ui-router.github.io/images/logos/ui-router.svg'
25+ } , {
26+ name : 'Sass' ,
27+ href : 'http://sass-lang.com/' ,
28+ image : 'http://sass-lang.com/assets/img/logos/logo-b6e1ef6e.svg'
29+ } ] ;
30+
31+ class ToolsService {
32+ get ( ) {
33+ return Promise . resolve ( tools ) ;
34+ }
35+ }
36+
37+ export default ToolsService ;
Original file line number Diff line number Diff line change 1+ @import ' ./footer' ;
File renamed without changes.
Original file line number Diff line number Diff line change 1- export const footer = {
1+ export default {
22 template : require ( './footer.html' )
33} ;
File renamed without changes.
Original file line number Diff line number Diff line change 1+ import FooterComponent from './footer.component' ;
2+
3+ const CommonModule = 'app.common' ;
4+
5+ export default CommonModule ;
6+
7+ angular
8+ . module ( CommonModule , [ ] )
9+ . component ( 'footer' , FooterComponent ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ hello {
1414 size : 18px ;
1515 }
1616
17- a {
17+ .tool {
1818 align-items : center ;
1919 background-position : center center ;
2020 background-repeat : no-repeat ;
Original file line number Diff line number Diff line change 1+ class HelloController {
2+ /** @ngInject */
3+ constructor ( $window , $log ) {
4+ this . window = $window ;
5+ this . log = $log ;
6+ }
7+
8+ $onInit ( ) {
9+ this . log . info ( 'Available tools:' , this . tools ) ;
10+ }
11+
12+ open ( tool ) {
13+ this . window . open ( tool . href , '_blank' ) ;
14+ }
15+ }
16+
17+ export default {
18+ bindings : {
19+ tools : '<'
20+ } ,
21+ template : require ( './hello.html' ) ,
22+ controller : HelloController
23+ } ;
Original file line number Diff line number Diff line change @@ -3,10 +3,9 @@ <h1>AngularJS + webpack seed project</h1>
33< p > Congratulations, you have correctly installed and run this seed project based on:</ p >
44
55< div class ="tools ">
6- < a ng-repeat ="tool in $ctrl.tools "
7- ng-href ="{{::tool.href}} "
8- title ="{{::tool.name}} "
9- style ="background-image: url({{::tool.image}}) "
10- target ="_blank ">
11- </ a >
6+ < div class ="tool "
7+ style ="background-image: url({{::tool.image}}) "
8+ ng-repeat ="tool in $ctrl.tools "
9+ ng-click ="$ctrl.open(tool) ">
10+ </ div >
1211</ div >
You can’t perform that action at this time.
0 commit comments