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 { OverlayRef } from '@angular/cdk/overlay'; | |
| import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
| import { Subject } from 'rxjs/Subject'; | |
| export class ConfirmationModalOverlayRef { | |
| public events = new BehaviorSubject<any>(null); | |
| constructor(private overlayRef: OverlayRef) { } | |
| public close(): void { | |
| this.overlayRef.dispose(); | |
| } |
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 CustomOverlayConfig { | |
| hasBackdropClick?: boolean; | |
| isCentered?: boolean; | |
| size?: any; | |
| top?: string; | |
| } | |
| const DEFAULT_CUSTOM_CONFIG: CustomOverlayConfig = { | |
| hasBackdropClick: false, | |
| isCentered: true, |
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
| #set( $nameparts = $NAME.split("_")) | |
| #set( $namepart = '') | |
| #set( $classname = '') | |
| #foreach( $namepart in $nameparts ) | |
| #set( $classname = $classname + $namepart.substring(0, 1).toUpperCase() + $namepart.substring(1)) | |
| #end | |
| class $classname { | |
| // TODO: add class properties and methods |
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 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/services.dart'; | |
| // See: https://twitter.com/shakil807/status/1042127387515858949 | |
| // https://github.com/pchmn/MaterialChipsInput/tree/master/library/src/main/java/com/pchmn/materialchips | |
| // https://github.com/BelooS/ChipsLayoutManager | |
| void main() => runApp(ChipsDemoApp()); |
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 { DataSource } from '@angular/cdk/collections'; | |
| import { MatPaginator, MatSort } from '@angular/material'; | |
| import { map } from 'rxjs/operators'; | |
| import { Observable, of as observableOf, merge } from 'rxjs'; | |
| /** | |
| * Data source for the NgxDataTable view. This class should | |
| * encapsulate all logic for fetching and manipulating the displayed data | |
| * (including sorting, pagination, and filtering). |
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 { Component, OnInit, ViewChild, Input } from '@angular/core'; | |
| import { MatPaginator, MatSort } from '@angular/material'; | |
| import { NgxDataTableDataSource } from './ngx-data-table-datasource'; | |
| @Component({ | |
| selector: 'ngx-data-table', | |
| templateUrl: './ngx-data-table.component.html', | |
| styleUrls: ['./ngx-data-table.component.css'] | |
| }) | |
| export class NgxDataTableComponent { |
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
| <h1>Angular 2 Recursive List</h1> | |
| <ul> | |
| <ng-template #recursiveList let-list> | |
| <li *ngFor="let item of list"> | |
| {{item.title}} | |
| <ul *ngIf="item.children.length > 0"> | |
| <ng-container *ngTemplateOutlet="recursiveList; context:{ $implicit: item.children }"></ng-container> | |
| </ul> | |
| </li> | |
| </ng-template> |
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
| # Get the latest from GitHub, public repo: | |
| $ npm install username/my-new-project --save-dev | |
| # GitHub, private repo: | |
| $ npm install git+https://token:[email protected]/username/my-new-project.git#master | |
| $ npm install git+ssh://[email protected]/username/my-new-project.git#master | |
| # … or from Bitbucket, public repo: | |
| $ npm install git+ssh://[email protected]/username/my-new-project.git#master --save-dev | |
| # Bitbucket, private repo: | |
| $ npm install git+https://username:[email protected]/username/my-new-project.git#master |
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 { Injectable } from '@angular/core'; | |
| import { | |
| ActivatedRouteSnapshot, | |
| CanActivate, | |
| Router, | |
| RouterStateSnapshot, | |
| } from '@angular/router'; | |
| import { Observable } from 'rxjs'; | |
| import { map } from 'rxjs/operators'; |
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 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:provider/provider.dart'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| const appTitle = 'StreamProvider Demo'; |