Skip to content

Commit b028da3

Browse files
IsmaestroIsmael Ramos
authored andcommitted
feat(new version): removed json-server and added API
fix(tests): solved problems with unit tests and e2e feat(readme): updated readme
1 parent 4875b2b commit b028da3

30 files changed

Lines changed: 155 additions & 102 deletions

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ Sample app made with :heart:
44

55
### Demo
66

7+
Live demo at: https://ismaestro.github.io/angular4-sample-app/
8+
79
![angular-2-sample-project](http://i65.tinypic.com/1jqhx2.jpg)
810

911
## Based on
10-
Angular 4, Bootstrap 4, Angular CLI and more plugins like ng2 translate and json-server
12+
Angular 4, Bootstrap 4, Angular CLI and more plugins like ng2 translate
13+
14+
## Server
15+
16+
This repo is using an API which is [a simple app](https://github.com/Ismaestro/tour-of-heroes-sample-app) in NodeJS deployed on Heroku, to create, modify and delete heroes
1117

1218
## How can I support developers?
1319
- Star the GitHub repo :star:
@@ -21,6 +27,8 @@ Angular 4, Bootstrap 4, Angular CLI and more plugins like ng2 translate and json
2127
* Sass
2228
* Angular 4
2329
* jQuery
30+
* Tests with Protractor
31+
* Github pages deploy ready
2432

2533
Enjoy :metal:
2634

e2e/app.po.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {browser, element, by} from 'protractor';
1+
import {browser, by, element} from 'protractor';
22

33
export class AngularTOHPage {
44
navigateTo() {

karma.conf.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
module.exports = function (config) {
22
config.set({
33
basePath: '',
4-
frameworks: ['jasmine', 'angular-cli'],
4+
frameworks: ['jasmine', '@angular/cli'],
55
plugins: [
66
require('karma-jasmine'),
77
require('karma-chrome-launcher'),
88
require('karma-remap-istanbul'),
9-
require('angular-cli/plugins/karma')
9+
require('@angular/cli/plugins/karma')
1010
],
1111
files: [
1212
{pattern: './src/test.ts', watched: false}
1313
],
1414
preprocessors: {
15-
'./src/test.ts': ['angular-cli']
15+
'./src/test.ts': ['@angular/cli']
1616
},
1717
mime: {
1818
'text/x-typescript': ['ts', 'tsx']
@@ -24,7 +24,7 @@ module.exports = function (config) {
2424
}
2525
},
2626
angularCli: {
27-
config: './angular-cli.json',
27+
config: './.angular-cli.json',
2828
environment: 'dev'
2929
},
3030
reporters: config.angularCli && config.angularCli.codeCoverage

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@angular/platform-server": "4.2.4",
2727
"@angular/router": "4.2.4",
2828
"@types/jasmine": "2.5.53",
29+
"@types/jasminewd2": "^2.0.2",
2930
"@types/node": "8.0.2",
3031
"angular-cli-ghpages": "0.5.1",
3132
"bootstrap": "4.0.0-alpha.6",
@@ -43,7 +44,7 @@
4344
"protractor": "5.1.2",
4445
"rxjs": "5.4.1",
4546
"ts-helpers": "1.1.2",
46-
"ts-node": "3.1.0",
47+
"ts-node": "3.0.0",
4748
"tslint": "5.4.3",
4849
"typescript": "2.3.4",
4950
"zone.js": "0.8.12"

protractor.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// https://github.com/angular/protractor/blob/master/lib/config.ts
33

44
/*global jasmine */
5-
var SpecReporter = require('jasmine-spec-reporter');
5+
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
66

77
exports.config = {
88
allScriptsTimeout: 11000,

src/app/app-routing.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {NgModule} from '@angular/core';
1+
import {NgModule} from '@angular/core';
22
import {RouterModule, Routes} from '@angular/router';
33

44
import {HeroTopComponent} from './heroes/hero-top/hero-top.component';

src/app/app.component.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.text-left {
2+
text-align: left !important;
3+
}
4+
5+
.text-right {
6+
text-align: right !important;
7+
}

src/app/app.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import {Component} from '@angular/core';
2-
import {TranslateService} from 'ng2-translate';
2+
import {TranslateService} from 'ng2-translate';
33
import {Title} from '@angular/platform-browser';
44

55
import {environment} from '../environments/environment';
66

77
@Component({
88
selector: 'toh-app',
9-
templateUrl: './app.component.html'
9+
templateUrl: './app.component.html',
10+
styles: ['./app.component.scss']
1011
})
1112

1213
export class AppComponent {

src/app/app.module.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import {NgModule} from '@angular/core';
2-
import {BrowserModule} from '@angular/platform-browser';
3-
import {FormsModule} from '@angular/forms';
4-
import {Http, HttpModule} from '@angular/http';
5-
import {TranslateModule, TranslateLoader} from 'ng2-translate';
6-
import {TranslateLoaderFactory} from './app.translate.factory';
1+
import {NgModule} from '@angular/core';
2+
import {BrowserModule} from '@angular/platform-browser';
3+
import {FormsModule} from '@angular/forms';
4+
import {Http, HttpModule} from '@angular/http';
5+
import {TranslateLoader, TranslateModule} from 'ng2-translate';
6+
import {TranslateLoaderFactory} from './app.translate.factory';
77

88
import {APP_CONFIG, AppConfig} from './config/app.config';
99

1010
import {AppRoutingModule} from './app-routing.module';
11-
import {SharedModule} from './shared/shared.module';
12-
import {CoreModule} from './core/core.module';
13-
import {HeroesModule} from './heroes/heroes.module';
11+
import {SharedModule} from './shared/shared.module';
12+
import {CoreModule} from './core/core.module';
13+
import {HeroesModule} from './heroes/heroes.module';
1414

15-
import {AppComponent} from './app.component';
15+
import {AppComponent} from './app.component';
1616
import {HeroTopComponent} from './heroes/hero-top/hero-top.component';
1717

1818
@NgModule({

src/app/config/app.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const AppConfig: IAppConfig = {
1111
heroById: heroesRoute + '/:id'
1212
},
1313
endpoints: {
14-
heroes: 'https://jsonblob.com/api/jsonBlob/11ba5f87-5997-11e7-ae4c-997a6628ed33',
15-
heroesPowers: 'https://jsonblob.com/api/jsonBlob/f8234363-5991-11e7-ae4c-eb7c024ddb08'
14+
heroes: 'https://tour-of-heroes-sample-app.herokuapp.com/heroes',
15+
heroesPowers: 'https://tour-of-heroes-sample-app.herokuapp.com/heroesPowers'
1616
}
1717
};

0 commit comments

Comments
 (0)