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
javascript:{email%20=%20document.querySelectorAll(".bz_reporter_column%20span");%20reporter%20=%20document.querySelectorAll(".bz_reporter_realname_column%20span");%20emails%20=%20[];%20function%20inFinals(x)%20{%20%20%20var%20uniq%20=%20false;%20%20%20var%20id;%20%20%20for(j%20=%200;%20j%20<%20emails.length;%20j++)%20{%20%20%20%20%20if%20(emails[j].email%20===%20x)%20{%20%20%20%20%20%20%20uniq%20=%20true;%20%20%20%20%20%20%20id%20=%20j;%20%20%20%20%20}%20%20%20}%20%20%20if%20(uniq)%20emails[id].count%20=%20emails[id].count%20+%201;%20%20%20return%20uniq;%20}%20for(i=0;%20i<email.length;%20i++)%20{%20%20%20if%20(!inFinals(email[i].title))%20{%20%20%20%20%20emails.push({reporter:%20reporter[i].title%20,%20email:%20email[i].title,%20count:%201});%20%20%20%20%20%20%20%20}%20%20%20%20}%20header%20=%20document.getElementById("header");%20table%20=%20document.createElement('table');%20var%20tr=document.createElement('thead');%20var%20td1%20=%20document.createElement('td');%20td1.textContent%20=%20"Name";%20var%20td2 |
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
describe('Component: Greeter', () => { | |
let fixture, greeter, element, de; | |
//setup | |
beforeEach(() => { | |
TestBed.configureTestingModule({ | |
declarations: [ Greeter ] | |
}); | |
fixture = TestBed.createComponent(Greeter); |
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
// Usage: <greeter name="Joe"></greeter> | |
// Renders: <h1>Hello Joe!</h1> | |
@Component({ | |
selector: 'greeter', | |
template: `<h1>Hello {{name}}!</h1>` | |
}) | |
export class Greeter { | |
@Input() name; | |
} |
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
//a simple service | |
export class LanguagesService { | |
get() { | |
return ['en', 'es', 'fr']; | |
} | |
} |
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
describe('Service: LanguagesService', () => { | |
let service; | |
beforeEach(() => TestBed.configureTestingModule({ | |
providers: [ LanguagesService ] | |
})); | |
beforeEach(inject([LanguagesService], s => { | |
service = s; | |
})); |
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
export class LanguagesServiceHttp { | |
constructor(private http:Http) { } | |
get(){ | |
return this.http.get('api/languages.json') | |
.map(response => response.json()); | |
} | |
} |
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
describe('Service: LanguagesServiceHttp', () => { | |
let service; | |
//setup | |
beforeEach(() => TestBed.configureTestingModule({ | |
imports: [ HttpModule ], | |
providers: [ LanguagesServiceHttp ] | |
})); | |
beforeEach(inject([LanguagesServiceHttp], s => { |
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
describe('MockBackend: LanguagesServiceHttp', () => { | |
let mockbackend, service; | |
//setup | |
beforeEach(() => { | |
TestBed.configureTestingModule({ | |
imports: [ HttpModule ], | |
providers: [ | |
LanguagesServiceHttp, | |
{ provide: XHRBackend, useClass: MockBackend } |
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
import {Pipe, PipeTransform} from '@angular/core'; | |
@Pipe({ | |
name: 'capitalise' | |
}) | |
export class CapitalisePipe implements PipeTransform { | |
transform(value: string): string { | |
if (typeof value !== 'string') { | |
throw new Error('Requires a String as input'); | |
} | |
return value.toUpperCase(); |
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
describe('Pipe: CapitalisePipe', () => { | |
let pipe; | |
//setup | |
beforeEach(() => TestBed.configureTestingModule({ | |
providers: [ CapitalisePipe ] | |
})); | |
beforeEach(inject([CapitalisePipe], p => { | |
pipe = p; |
OlderNewer