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
// rollup.config.js with typescript and node module , angular templateUrl / styleUrl resolution & SASS processing | |
import angular from 'rollup-plugin-angular'; | |
import typescript from 'rollup-plugin-typescript'; | |
import nodeResolve from 'rollup-plugin-node-resolve'; | |
import sass from 'node-sass'; | |
export default { | |
entry: 'dist/index.js', | |
dest: 'dist/bundles/amazing.umd.js', | |
sourceMap: 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
import { Directive, ElementRef, Renderer2, Input, OnInit } from '@angular/core'; | |
@Directive({ selector: '[attrDirective]' }) | |
export class AttributeDirective { | |
@Input('statusField') statusField: string; | |
constructor(private el: ElementRef, private renderer: Renderer2) { // use Renderer2 as Renderer is deprecated | |
this.renderer.addClass(el.nativeElement, 'label'); // add Bootstrap label classes. need to access the nativeElement | |
} | |
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 {DebugElement} from '@angular/core'; | |
import {async, ComponentFixture, ComponentFixtureAutoDetect, TestBed} from '@angular/core/testing'; | |
import {By} from '@angular/platform-browser'; | |
// import {RouterTestingModule} from '@angular/router/testing'; | |
describe('ComponentUnderTest ', () => { | |
let comp: ComponentUnderTest; | |
let fixture: ComponentFixture<ComponentUnderTest>; | |
let de: DebugElement; |
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, OnInit } from '@angular/core'; | |
import { Router, ActivatedRoute } from '@angular/router'; | |
import 'rxjs/add/observable/combineLatest'; | |
import { Observable } from 'rxjs/Observable'; | |
@Component( { | |
selector: 'test-route', | |
templateUrl: './test-route.component.html' | |
} ) |
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
console.log( 'lowercase alphabet %s', String.fromCharCode( ...Array( 123 ).keys() ).slice( 97 ) ); | |
console.log( 'uppercase alphabet %s',String.fromCharCode( ...Array( 91 ).keys() ).slice( 65 ) ); |
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
0xe84ca4c2bb68ecd98c16ffa3e109c6f227107729 |
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
0x1adaacf544619445388d99614a1a7cffd892cc7f |
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
// from() – determine the result’s constructor via the receiver | |
// (in this case, MyArray) | |
let instanceOfMyArray = MyArray.from([1, 2, 3], x => x * x); | |
// map(): the result is always an instance of Array | |
let instanceOfArray = [1, 2, 3].map(x => x * x); |
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
{ | |
"files.exclude": { | |
"**/.git": true, | |
"**/.svn": true, | |
"**/.hg": true, | |
"**/CVS": true, | |
"**/.DS_Store": true, | |
"**/*.js.map": true, | |
"**/*.js": { "when": "$(basename).ts"} | |
} |
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
ul li { | |
/* | |
* We want the bullets outside of the list, | |
* so the text is aligned. Now the actual bullet | |
* is outside of the list’s container | |
*/ | |
list-style-position: outside; | |
/* | |
* Because the bullet is outside of the list’s |
OlderNewer