Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7189e16
Showing
45 changed files
with
1,271 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Editor configuration, see http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = 0 | ||
trim_trailing_whitespace = false |
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,33 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# compiled output | ||
/dist | ||
/tmp | ||
|
||
# dependencies | ||
/node_modules | ||
/bower_components | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
*.launch | ||
.settings/ | ||
|
||
# misc | ||
/.sass-cache | ||
/connect.lock | ||
/coverage/* | ||
/libpeerconnection.log | ||
npm-debug.log | ||
testem.log | ||
/typings | ||
|
||
# e2e | ||
/e2e/*.js | ||
/e2e/*.map | ||
|
||
#System Files | ||
.DS_Store | ||
Thumbs.db |
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,44 @@ | ||
{ | ||
"project": { | ||
"version": "1.0.0-beta.15", | ||
"name": "angular2-university-domain-list" | ||
}, | ||
"apps": [ | ||
{ | ||
"root": "src", | ||
"outDir": "dist", | ||
"assets": "assets", | ||
"index": "index.html", | ||
"main": "main.ts", | ||
"test": "test.ts", | ||
"tsconfig": "tsconfig.json", | ||
"prefix": "app", | ||
"mobile": false, | ||
"styles": [ | ||
"styles.css" | ||
], | ||
"scripts": [], | ||
"environments": { | ||
"source": "environments/environment.ts", | ||
"dev": "environments/environment.ts", | ||
"prod": "environments/environment.prod.ts" | ||
} | ||
} | ||
], | ||
"addons": [], | ||
"packages": [], | ||
"e2e": { | ||
"protractor": { | ||
"config": "./protractor.conf.js" | ||
} | ||
}, | ||
"test": { | ||
"karma": { | ||
"config": "./karma.conf.js" | ||
} | ||
}, | ||
"defaults": { | ||
"styleExt": "css", | ||
"prefixInterfaces": false | ||
} | ||
} |
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,14 @@ | ||
import { Angular2UniversityDomainListPage } from './app.po'; | ||
|
||
describe('angular2-university-domain-list App', function() { | ||
let page: Angular2UniversityDomainListPage; | ||
|
||
beforeEach(() => { | ||
page = new Angular2UniversityDomainListPage(); | ||
}); | ||
|
||
it('should display message saying app works', () => { | ||
page.navigateTo(); | ||
expect(page.getParagraphText()).toEqual('app works!'); | ||
}); | ||
}); |
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,11 @@ | ||
import { browser, element, by } from 'protractor/globals'; | ||
|
||
export class Angular2UniversityDomainListPage { | ||
navigateTo() { | ||
return browser.get('/'); | ||
} | ||
|
||
getParagraphText() { | ||
return element(by.css('app-root h1')).getText(); | ||
} | ||
} |
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,16 @@ | ||
{ | ||
"compileOnSave": false, | ||
"compilerOptions": { | ||
"declaration": false, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"outDir": "../dist/out-tsc-e2e", | ||
"sourceMap": true, | ||
"target": "es5", | ||
"typeRoots": [ | ||
"../node_modules/@types" | ||
] | ||
} | ||
} |
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,38 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/0.13/config/configuration-file.html | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['jasmine', 'angular-cli'], | ||
plugins: [ | ||
require('karma-jasmine'), | ||
require('karma-chrome-launcher'), | ||
require('karma-remap-istanbul'), | ||
require('angular-cli/plugins/karma') | ||
], | ||
files: [ | ||
{ pattern: './src/test.ts', watched: false } | ||
], | ||
preprocessors: { | ||
'./src/test.ts': ['angular-cli'] | ||
}, | ||
remapIstanbulReporter: { | ||
reports: { | ||
html: 'coverage', | ||
lcovonly: './coverage/coverage.lcov' | ||
} | ||
}, | ||
angularCli: { | ||
config: './angular-cli.json', | ||
environment: 'dev' | ||
}, | ||
reporters: ['progress', 'karma-remap-istanbul'], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ['Chrome'], | ||
singleRun: false | ||
}); | ||
}; |
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,61 @@ | ||
{ | ||
"name": "angular2-university-domain-list", | ||
"author": "Taha İPEK", | ||
"version": "0.0.1", | ||
"license": "MIT", | ||
"angular-cli": {}, | ||
"scripts": { | ||
"start": "ng serve", | ||
"lint": "tslint \"src/**/*.ts\"", | ||
"test": "ng test", | ||
"pree2e": "webdriver-manager update", | ||
"e2e": "protractor" | ||
}, | ||
"private": true, | ||
"dependencies": { | ||
"@angular/common": "2.0.0", | ||
"@angular/compiler": "2.0.0", | ||
"@angular/core": "2.0.0", | ||
"@angular/forms": "2.0.0", | ||
"@angular/http": "2.0.0", | ||
"@angular/platform-browser": "2.0.0", | ||
"@angular/platform-browser-dynamic": "2.0.0", | ||
"@angular/router": "3.0.0", | ||
"core-js": "^2.4.1", | ||
"rxjs": "5.0.0-beta.12", | ||
"ts-helpers": "^1.1.1", | ||
"zone.js": "^0.6.23" | ||
}, | ||
"devDependencies": { | ||
"@types/jasmine": "^2.2.30", | ||
"angular-cli": "1.0.0-beta.15", | ||
"codelyzer": "~0.0.26", | ||
"jasmine-core": "2.4.1", | ||
"jasmine-spec-reporter": "2.5.0", | ||
"karma": "1.2.0", | ||
"karma-chrome-launcher": "^2.0.0", | ||
"karma-cli": "^1.0.1", | ||
"karma-jasmine": "^1.0.2", | ||
"karma-remap-istanbul": "^0.2.1", | ||
"protractor": "4.0.5", | ||
"ts-node": "1.2.1", | ||
"tslint": "3.13.0", | ||
"typescript": "2.0.2" | ||
}, | ||
"description": "This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.15.", | ||
"main": "karma.conf.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/tahaipek/angular2-university-domains-list.git" | ||
}, | ||
"keywords": [ | ||
"angular2", | ||
"ng", | ||
"cli", | ||
"jsx" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/tahaipek/angular2-university-domains-list/issues" | ||
}, | ||
"homepage": "https://github.com/tahaipek/angular2-university-domains-list#readme" | ||
} |
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,32 @@ | ||
// Protractor configuration file, see link for more information | ||
// https://github.com/angular/protractor/blob/master/docs/referenceConf.js | ||
|
||
/*global jasmine */ | ||
var SpecReporter = require('jasmine-spec-reporter'); | ||
|
||
exports.config = { | ||
allScriptsTimeout: 11000, | ||
specs: [ | ||
'./e2e/**/*.e2e-spec.ts' | ||
], | ||
capabilities: { | ||
'browserName': 'chrome' | ||
}, | ||
directConnect: true, | ||
baseUrl: 'http://localhost:4200/', | ||
framework: 'jasmine', | ||
jasmineNodeOpts: { | ||
showColors: true, | ||
defaultTimeoutInterval: 30000, | ||
print: function() {} | ||
}, | ||
useAllAngular2AppRoots: true, | ||
beforeLaunch: function() { | ||
require('ts-node').register({ | ||
project: 'e2e' | ||
}); | ||
}, | ||
onPrepare: function() { | ||
jasmine.getEnv().addReporter(new SpecReporter()); | ||
} | ||
}; |
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,16 @@ | ||
/* tslint:disable:no-unused-variable */ | ||
|
||
import { TestBed, async, inject } from '@angular/core/testing'; | ||
import { UniversityApiService } from './university-api.service'; | ||
|
||
describe('Service: UniversityApi', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [UniversityApiService] | ||
}); | ||
}); | ||
|
||
it('should ...', inject([UniversityApiService], (service: UniversityApiService) => { | ||
expect(service).toBeTruthy(); | ||
})); | ||
}); |
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,32 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Http } from '@angular/http'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import 'rxjs/add/operator/map'; | ||
import { University } from '../model/model.university'; | ||
|
||
@Injectable() | ||
export class UniversityApiService { | ||
baseUrl: string; | ||
|
||
constructor(private http: Http) { | ||
this.baseUrl = 'http://universities.hipolabs.com/search'; | ||
} | ||
|
||
getUniversity(): Observable<University[]> { | ||
return this.http.get(`${this.baseUrl}?`).map(response => response.json()); | ||
} | ||
|
||
getUniversityByFilter(name: string, country: string): Observable<University[]> { | ||
let url = this.baseUrl + '?'; | ||
if (name) { | ||
url += 'name=' + name + '&'; | ||
} | ||
|
||
if (country) { | ||
url += 'country=' + country; | ||
} | ||
console.log(url); | ||
return this.http.get(url).map(response => response.json()); | ||
} | ||
|
||
} |
Empty file.
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,9 @@ | ||
<app-header></app-header> | ||
|
||
<div id="wrapper" class="container"> | ||
<h4 class="card-title">{{title}}<small *ngIf="counter"> / Total Record:{{counter}} </small></h4> | ||
<app-searchform [(universities)]="universities"></app-searchform> | ||
|
||
<app-university-item [(universities)]="universities"></app-university-item> | ||
|
||
</div> |
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,33 @@ | ||
/* tslint:disable:no-unused-variable */ | ||
|
||
import { TestBed, async } from '@angular/core/testing'; | ||
import { AppComponent } from './app.component'; | ||
|
||
describe('App: Angular2UniversityDomainList', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ | ||
AppComponent | ||
], | ||
}); | ||
}); | ||
|
||
it('should create the app', async(() => { | ||
let fixture = TestBed.createComponent(AppComponent); | ||
let app = fixture.debugElement.componentInstance; | ||
expect(app).toBeTruthy(); | ||
})); | ||
|
||
it(`should have as title 'app works!'`, async(() => { | ||
let fixture = TestBed.createComponent(AppComponent); | ||
let app = fixture.debugElement.componentInstance; | ||
expect(app.title).toEqual('app works!'); | ||
})); | ||
|
||
it('should render title in a h1 tag', async(() => { | ||
let fixture = TestBed.createComponent(AppComponent); | ||
fixture.detectChanges(); | ||
let compiled = fixture.debugElement.nativeElement; | ||
expect(compiled.querySelector('h1').textContent).toContain('app works!'); | ||
})); | ||
}); |
Oops, something went wrong.