File tree Expand file tree Collapse file tree 6 files changed +75
-2
lines changed Expand file tree Collapse file tree 6 files changed +75
-2
lines changed Original file line number Diff line number Diff line change 1+ < main >
2+ < h1 class ="title "> Hello from Angular !</ h1 >
3+
4+ <!-- Images (and assets) are parsed and loaded from within the public directory -->
5+ < img src ="/img/logo.png ">
6+ </ main >
7+ < footer >
8+ < a ng-href ="{{app.url}} "> Webpack Angular Starter</ a >
9+ </ footer >
Original file line number Diff line number Diff line change 11import angular from 'angular' ;
22
3- angular . module ( 'app' , [ ] ) ;
3+ import '../style/app.css' ;
4+
5+ let app = ( ) => {
6+ return {
7+ template : require ( './app.html' ) ,
8+ controller : 'AppCtrl' ,
9+ controllerAs : 'app'
10+ }
11+ } ;
12+
13+ class AppCtrl {
14+ constructor ( ) {
15+ this . url = 'https://github.com/preboot/angular-webpack' ;
16+ }
17+ }
18+
19+ const MODULE_NAME = 'app' ;
20+
21+ angular . module ( MODULE_NAME , [ ] )
22+ . directive ( 'app' , app )
23+ . controller ( 'AppCtrl' , AppCtrl ) ;
24+
25+ export default MODULE_NAME ;
Original file line number Diff line number Diff line change 1+ import app from './app' ;
2+
3+ describe ( 'app' , ( ) => {
4+
5+ describe ( 'AppCtrl' , ( ) => {
6+ let ctrl ;
7+
8+ beforeEach ( ( ) => {
9+ angular . mock . module ( app ) ;
10+
11+ angular . mock . inject ( ( $controller ) => {
12+ ctrl = $controller ( 'AppCtrl' , { } ) ;
13+ } ) ;
14+ } ) ;
15+
16+ it ( 'should contain the starter url' , ( ) => {
17+ expect ( ctrl . url ) . toBe ( 'https://github.com/preboot/angular-webpack' ) ;
18+ } ) ;
19+ } ) ;
20+ } ) ;
Original file line number Diff line number Diff line change 88 < base href ="/ ">
99</ head >
1010< body >
11- Hello, World
11+ < app > </ app >
1212</ body >
1313</ html >
Original file line number Diff line number Diff line change 1+ /* styles in src/style directory are applied to the whole page */
2+ body {
3+ background : # 0147A7 ;
4+ color : # fff ;
5+ }
6+
7+ a {
8+ color : # 03A9F4 ;
9+ }
10+
11+ main {
12+ padding : 1em ;
13+ font-family : Arial, Helvetica, sans-serif;
14+ text-align : center;
15+ margin-top : 50px ;
16+ display : block;
17+ }
18+
19+ footer {
20+ text-align : center;
21+ font-size : 0.8em ;
22+ }
You can’t perform that action at this time.
0 commit comments