const routes: Routes = [
{
path: '',
component: ProgressPageComponent,
data: {
- statusFilterName: ProgressDashboardOptionedCampaignFiltersControl.CONTRACT_STATUS,
+ statusFilterName: ProgressDashboardOptionedCampaignFiltersControl.CONTRACT_STATUS.valueOf(),
}
}
This file contains hidden or 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
class BudgeOptimizer { | |
private _prices: number[]; | |
constructor(prices: number[], private _budget: number) { | |
this._prices = prices.sort((a, b) => a - b); | |
} | |
get count() { | |
let inc = 0; | |
let total = 0; |
This file contains hidden or 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 IQueue { | |
put(value: number): void; | |
pop(): void; | |
peek(): number | null; | |
} | |
class Stack implements IQueue { | |
private _stack: number[] = []; | |
put(value: number): void { |
This file contains hidden or 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
$colors: ( | |
0: #3B3EAC, | |
1: #3366CC, | |
2: #DC3912, | |
3: #FF9900, | |
4: #109618, | |
5: #990099, | |
6: #3B3EAC, | |
7: #0099C6, | |
8: #DD4477, |
This file contains hidden or 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
{ | |
"$schema": "../../node_modules/@angular-devkit/schematics/collection-schema.json", | |
"name": "my-schematics-collection", | |
"version": "0.0.1", | |
"extends": ["@nrwl/schematics"], | |
"schematics": { | |
"my-schematic-name": { | |
"factory": "../../dist/out-tsc/tools/schematics/my-schematic-name", | |
"schema": "./my-schematic-name/schema.json", | |
"description": "Do awesome stuff" |
This file contains hidden or 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 { Observable } from 'rxjs/Observable'; | |
import { DataSource } from '@angular/cdk/collections'; | |
import { Component, OnInit, OnDestroy, Input } from '@angular/core'; | |
import { MyAwesomeData } from './my/awesome/data.model.ts'; | |
@Component({ | |
selector: 'app-some', | |
templateUrl: './app-some.component.html', |
This file contains hidden or 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 { Subject } from 'rxjs/Subject'; | |
import { takeUntil } from 'rxjs/operators'; | |
import { Observable } from 'rxjs/Observable'; | |
import { DataSource } from '@angular/cdk/collections'; | |
export class ReactiveDataSource<T> extends DataSource<T> { | |
private _disconnector: Subject<void> = new Subject(); | |
private _source: Observable<T[]>; |
This file contains hidden or 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 { Observable } from 'rxjs/Observable'; | |
import { DataSource } from '@angular/cdk/collections'; | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
export class EntityDataSource<T extends { id: string }> extends DataSource<T> { | |
private source: BehaviorSubject<T[]> = new BehaviorSubject<T[]>([]); | |
get data(): T[] { | |
return this.source.value; | |
} |
This file contains hidden or 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
// Extracted from Angular Material Collections CDK https://goo.gl/GYpMwZ | |
export abstract class DataSource<T> { | |
abstract connect(collectionViewer: CollectionViewer): Observable<T[]>; | |
abstract disconnect(collectionViewer: CollectionViewer): void; | |
} |
This file contains hidden or 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
// Extracted from CDK Tabe basic example https://goo.gl/T4eHRE | |
export class ExampleDataSource extends DataSource<any> { | |
constructor(private _exampleDatabase: ExampleDatabase) { | |
super(); | |
} | |
connect(): Observable<UserData[]> { | |
return this._exampleDatabase.dataChange; | |
} |
NewerOlder