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 Product { | |
name: string; | |
description: string; | |
} | |
let currentProduct: Product = { | |
name: "FS2000", | |
description: "Hippie Control" | |
}; | |
function update1(product: Product) { | |
Object.assign(currentProduct, product); |
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 Todo { | |
id:string; | |
title:string; | |
complete?:boolean; | |
} | |
let completed: boolean = true; | |
let todo:Todo = {title: "Do the Dew", id:"1"}; |
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 { expect } from "chai"; | |
import "mocha"; | |
import {push} from './index'; | |
describe("Push", () => { | |
it("should have four elements post push", () => { | |
const original = ['a', 'b']; | |
const result = ['a', 'b', 'c', 'd']; | |
expect(push(original, 'c', 'd')).to.eql(result);; | |
}); |
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
/** | |
* Pushes the elements onto the end of the array. | |
* | |
* @param original The original array | |
* @param elementN The arguments to be inserted | |
* @return The result array | |
* | |
@example | |
<pre> | |
const original = ['a', 'b']; |
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
private supportsSvg; | |
private hasHtml5FileApiSupport; | |
constructor(@Optional() @Inject(DOCUMENT) document: Document) { | |
this.hasHtml5FileApiSupport = w.File && w.FileReader && w.FileList && w.Blob; | |
this.supportsSvg = !!( | |
document && | |
document.createElementNS && | |
document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect); | |
} |
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 { NgModule } from '@angular/core'; | |
import { | |
MatButtonModule, | |
MatIconModule, | |
MatToolbarModule | |
} from '@angular/material'; | |
const modules = [ | |
MatButtonModule, |
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, Output, EventEmitter } from '@angular/core'; | |
@Component({ | |
selector: 'my-toolbar', | |
template: ` | |
<mat-toolbar color="primary"> | |
<button mat-icon-button (click)="menu.emit()"> | |
<mat-icon>menu</mat-icon> | |
</button> | |
<ng-content></ng-content> |
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
/* Add application styles & imports to this file! */ | |
/* You can add global styles to this file, and also import other style files */ | |
@import "~@angular/material/prebuilt-themes/deeppurple-amber.css"; | |
* { | |
box-sizing: border-box; | |
} |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>Your Toolbar</title> | |
<base href="/"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="icon" type="image/x-icon" href="favicon.ico"> |
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, Output, EventEmitter } from '@angular/core'; | |
@Component({ | |
selector: 'my-toolbar', | |
template: ` | |
<mat-toolbar color="primary"> | |
<button mat-icon-button (click)="menu.emit()"> | |
<mat-icon>menu</mat-icon> | |
</button> | |
<ng-content></ng-content> |
OlderNewer