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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Document</title> | |
<script> | |
class CleImage extends HTMLElement { | |
constructor() { |
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
interface Friend { | |
id: number; | |
name: string; | |
expense: number; | |
} | |
interface Transaction { | |
from: number; | |
to: number; | |
value: number; |
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
// 1. une source de données | |
class DataSource { | |
ondata: (data: number) => void = () => { }; | |
interval: number; | |
constructor() { | |
let i = 0; | |
this.interval = setInterval(() => this.emit(++i), 1000); | |
} |
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
// reverse_test.js | |
module.exports = { | |
'Test reverse input' : function (browser) { | |
browser | |
.url('http://localhost:4200') | |
.waitForElementPresent('bc-reverse', 1000) | |
.setValue('bc-reverse input', 'ByteClub') | |
.pause(1000); | |
browser.expect.element('bc-reverse strong').text.to.equal('bulCetyB'); |
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
// byteclub_test.js | |
module.exports = { | |
'Test ByteClub website' : function (browser) { | |
browser | |
// On navigue vers une url | |
.url('http://byteclub.fr') | |
// On clique sur un lien (trouvé avec un selecteur css) | |
.click('.nav.nav-main li:nth-child(5) a') | |
// et on attend un peu | |
.pause(1000); |
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
// byteclub_test.js | |
module.exports = { | |
'Test ByteClub website' : function (browser) { | |
browser | |
.url('http://byteclub.fr') | |
.click('.nav.nav-main li:nth-child(5) a') | |
.pause(1000); | |
browser.expect.element('h1.page-title').text.to.contains('Qui sommes nous ?'); |
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
{ | |
"src_folders" : ["tests"], | |
"output_folder" : "reports", | |
"test_settings" : { | |
"default" : { | |
"launch_url" : "http://localhost", | |
"selenium_port" : 4444, | |
"selenium_host" : "localhost", | |
"silent": 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
"webdriver": "webdriver-manager start", | |
"nw": "wait-on http://localhost:4444 && nightwatch" |
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: 'reverse' | |
}) | |
export class ReversePipe implements PipeTransform { | |
transform(value: string): string { | |
return value.split('').reverse().join(''); | |
} |
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 { Component } from '@angular/core'; | |
@Component({ | |
selector: 'bc-reverse', | |
template: ` | |
<input [(ngModel)]="value"> | |
<strong>{{ value | reverse }}</strong> | |
` | |
}) | |
export class ReverseComponent { |
NewerOlder