-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from evansmwendwa/feature/angular-cli
Feature/angular cli
- Loading branch information
Showing
33 changed files
with
772 additions
and
58 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,59 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"project": { | ||
"name": "ci" | ||
}, | ||
"apps": [ | ||
{ | ||
"root": "src", | ||
"outDir": "dist", | ||
"assets": [ | ||
"assets", | ||
"favicon.ico" | ||
], | ||
"index": "index.html", | ||
"main": "main.ts", | ||
"polyfills": "polyfills.ts", | ||
"test": "test.ts", | ||
"tsconfig": "tsconfig.app.json", | ||
"testTsconfig": "tsconfig.spec.json", | ||
"prefix": "app", | ||
"styles": [ | ||
"styles.css" | ||
], | ||
"scripts": [ | ||
|
||
], | ||
"environmentSource": "environments/environment.ts", | ||
"environments": { | ||
"dev": "environments/environment.ts", | ||
"prod": "environments/environment.prod.ts" | ||
} | ||
} | ||
], | ||
"e2e": { | ||
"protractor": { | ||
"config": "./protractor.conf.js" | ||
} | ||
}, | ||
"lint": [ | ||
{ | ||
"project": "src/tsconfig.app.json" | ||
}, | ||
{ | ||
"project": "src/tsconfig.spec.json" | ||
}, | ||
{ | ||
"project": "e2e/tsconfig.e2e.json" | ||
} | ||
], | ||
"test": { | ||
"karma": { | ||
"config": "./karma.conf.js" | ||
} | ||
}, | ||
"defaults": { | ||
"styleExt": "css", | ||
"component": {} | ||
} | ||
} |
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 @@ | ||
# Editor configuration, see http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = 0 | ||
trim_trailing_whitespace = false | ||
|
||
[*.{json,config.js}] | ||
indent_size = 2 |
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
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
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 { CiPage } from './app.po'; | ||
|
||
describe('ci App', () => { | ||
let page: CiPage; | ||
|
||
beforeEach(() => { | ||
page = new CiPage(); | ||
}); | ||
|
||
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'; | ||
|
||
export class CiPage { | ||
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,12 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../out-tsc/e2e", | ||
"module": "commonjs", | ||
"target": "es5", | ||
"types":[ | ||
"jasmine", | ||
"node" | ||
] | ||
} | ||
} |
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 @@ | ||
// 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-jasmine-html-reporter'), | ||
require('karma-coverage-istanbul-reporter'), | ||
require('@angular/cli/plugins/karma') | ||
], | ||
client:{ | ||
clearContext: false // leave Jasmine Spec Runner output visible in browser | ||
}, | ||
files: [ | ||
{ pattern: './src/test.ts', watched: false } | ||
], | ||
preprocessors: { | ||
'./src/test.ts': ['@angular/cli'] | ||
}, | ||
mime: { | ||
'text/x-typescript': ['ts','tsx'] | ||
}, | ||
coverageIstanbulReporter: { | ||
reports: [ 'html', 'lcovonly' ], | ||
fixWebpackSourcePaths: true | ||
}, | ||
angularCli: { | ||
environment: 'dev' | ||
}, | ||
reporters: config.angularCli && config.angularCli.codeCoverage | ||
? ['progress', 'coverage-istanbul'] | ||
: ['progress', 'kjhtml'], | ||
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
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,30 @@ | ||
// Protractor configuration file, see link for more information | ||
// https://github.com/angular/protractor/blob/master/lib/config.ts | ||
|
||
const { 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() {} | ||
}, | ||
beforeLaunch: function() { | ||
require('ts-node').register({ | ||
project: 'e2e/tsconfig.e2e.json' | ||
}); | ||
}, | ||
onPrepare() { | ||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); | ||
} | ||
}; |
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,3 @@ | ||
.main-container{ | ||
max-width: 650px; | ||
} |
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,75 @@ | ||
<div class="container-fluid main-container"> | ||
<h1>ng2-daterangepicker (Demos)</h1> | ||
<br /><br /> | ||
|
||
<form> | ||
<h3>Using Datepicker with Events</h3> | ||
<div style="max-height:250px; overflow-y:scroll;"> | ||
<pre> | ||
{{ eventLog }} | ||
</pre> | ||
</div> | ||
<div class="form-group"> | ||
|
||
<div class="input-group" daterangepicker (selected)="selectedDate($event, mainInput)" | ||
(cancelDaterangepicker)="calendarEventsHandler($event)" | ||
(applyDaterangepicker)="calendarEventsHandler($event)" | ||
(hideDaterangepicker)="calendarEventsHandler($event)" | ||
(showDaterangepicker)="calendarEventsHandler($event)" | ||
> | ||
<span class="form-control uneditable-input" name="daterange" > | ||
{{ mainInput.start | date:'M/dd/y' }} - {{ mainInput.end| date:'M/dd/y' }} | ||
</span> | ||
<span class="input-group-btn"> | ||
<a type="button" class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></a> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<p> | ||
Above example demonstrates how to tap to the events fired by the daterangepicker | ||
</p> | ||
|
||
<hr /> | ||
|
||
<h3>Single Datepicker</h3> | ||
|
||
<div class="form-group"> | ||
|
||
<div class="input-group" daterangepicker [options]="singlePicker" (selected)="singleSelect($event)"> | ||
<span class="form-control uneditable-input" name="daterange" > | ||
{{ singleDate | date:'M/dd/y' }} | ||
</span> | ||
<span class="input-group-btn"> | ||
<a type="button" class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></a> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<p> | ||
Above example demonstrates how to tap to the events fired by the daterangepicker | ||
</p> | ||
|
||
<hr /> | ||
|
||
<h3>Different Presets</h3> | ||
|
||
<div class="form-group" *ngFor="let dateInput of dateInputs"> | ||
|
||
<div class="input-group" daterangepicker [options]="{startDate:dateInput.start, endDate:dateInput.end }" (selected)="selectedDate($event, dateInput)" > | ||
<span class="form-control uneditable-input" name="daterange" > | ||
{{ dateInput.start | date:'M/dd/y' }} - {{ dateInput.end| date:'M/dd/y' }} | ||
</span> | ||
<span class="input-group-btn"> | ||
<a type="button" class="btn btn-default"><i class="glyphicon glyphicon-calendar"></i></a> | ||
</span> | ||
</div> | ||
|
||
<br /> | ||
|
||
<pre>{{ dateInput | json }}</pre> | ||
<hr /> | ||
</div> | ||
</form> | ||
|
||
</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,32 @@ | ||
import { TestBed, async } from '@angular/core/testing'; | ||
|
||
import { AppComponent } from './app.component'; | ||
|
||
describe('AppComponent', () => { | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ | ||
AppComponent | ||
], | ||
}).compileComponents(); | ||
})); | ||
|
||
it('should create the app', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
expect(app).toBeTruthy(); | ||
})); | ||
|
||
it(`should have as title 'app works!'`, async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
expect(app.title).toEqual('app works!'); | ||
})); | ||
|
||
it('should render title in a h1 tag', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
fixture.detectChanges(); | ||
const compiled = fixture.debugElement.nativeElement; | ||
expect(compiled.querySelector('h1').textContent).toContain('app works!'); | ||
})); | ||
}); |
Oops, something went wrong.