This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +35
-5
lines changed Expand file tree Collapse file tree 6 files changed +35
-5
lines changed Original file line number Diff line number Diff line change 33// Define the `phonecatApp` module
44angular . module ( 'phonecatApp' , [
55 'ngRoute' ,
6+ 'core' ,
67 'phoneDetail' ,
78 'phoneList' ,
89] ) ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ angular .
4+ module ( 'core' ) .
5+ filter ( 'checkmark' , function ( ) {
6+ return function ( input ) {
7+ return input ? '\u2713' : '\u2718' ;
8+ } ;
9+ } ) ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ describe ( 'checkmark' , function ( ) {
4+
5+ beforeEach ( module ( 'core' ) ) ;
6+
7+ it ( 'should convert boolean values to unicode checkmark or cross' ,
8+ inject ( function ( checkmarkFilter ) {
9+ expect ( checkmarkFilter ( true ) ) . toBe ( '\u2713' ) ;
10+ expect ( checkmarkFilter ( false ) ) . toBe ( '\u2718' ) ;
11+ } )
12+ ) ;
13+
14+ } ) ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ // Define the `core` module
4+ angular . module ( 'core' , [ ] ) ;
Original file line number Diff line number Diff line change 99 < script src ="bower_components/angular-route/angular-route.js "> </ script >
1010 < script src ="app.module.js "> </ script >
1111 < script src ="app.config.js "> </ script >
12+ < script src ="core/core.module.js "> </ script >
13+ < script src ="core/checkmark/checkmark.filter.js "> </ script >
1214 < script src ="phone-list/phone-list.module.js "> </ script >
1315 < script src ="phone-list/phone-list.component.js "> </ script >
1416 < script src ="phone-detail/phone-detail.module.js "> </ script >
Original file line number Diff line number Diff line change @@ -48,9 +48,9 @@ <h1>{{$ctrl.phone.name}}</h1>
4848 < dt > Bluetooth</ dt >
4949 < dd > {{$ctrl.phone.connectivity.bluetooth}}</ dd >
5050 < dt > Infrared</ dt >
51- < dd > {{$ctrl.phone.connectivity.infrared}}</ dd >
51+ < dd > {{$ctrl.phone.connectivity.infrared | checkmark }}</ dd >
5252 < dt > GPS</ dt >
53- < dd > {{$ctrl.phone.connectivity.gps}}</ dd >
53+ < dd > {{$ctrl.phone.connectivity.gps | checkmark }}</ dd >
5454 </ dl >
5555 </ li >
5656 < li >
@@ -79,7 +79,7 @@ <h1>{{$ctrl.phone.name}}</h1>
7979 < dt > Screen resolution</ dt >
8080 < dd > {{$ctrl.phone.display.screenResolution}}</ dd >
8181 < dt > Touch screen</ dt >
82- < dd > {{$ctrl.phone.display.touchScreen}}</ dd >
82+ < dd > {{$ctrl.phone.display.touchScreen | checkmark }}</ dd >
8383 </ dl >
8484 </ li >
8585 < li >
@@ -92,9 +92,9 @@ <h1>{{$ctrl.phone.name}}</h1>
9292 < dt > Audio / headphone jack</ dt >
9393 < dd > {{$ctrl.phone.hardware.audioJack}}</ dd >
9494 < dt > FM Radio</ dt >
95- < dd > {{$ctrl.phone.hardware.fmRadio}}</ dd >
95+ < dd > {{$ctrl.phone.hardware.fmRadio | checkmark }}</ dd >
9696 < dt > Accelerometer</ dt >
97- < dd > {{$ctrl.phone.hardware.accelerometer}}</ dd >
97+ < dd > {{$ctrl.phone.hardware.accelerometer | checkmark }}</ dd >
9898 </ dl >
9999 </ li >
100100 < li >
You can’t perform that action at this time.
0 commit comments