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 { ChangeDetectionStrategy, Component, Inject } from "@angular/core"; | |
import { ActivatedRoute } from "@angular/router"; | |
import { OBSERVE, ObserveFn, OBSERVE_PROVIDER, toValue } from "ng-observe"; | |
import { map } from "rxjs/operators"; | |
@Component({ | |
template: ` | |
<div class="posts"> | |
<app-nav icon="prev" [link]="prev" [disabled]="!prev"></app-nav> |
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 { ChangeDetectionStrategy, Component, Inject } from "@angular/core"; | |
import { ActivatedRoute } from "@angular/router"; | |
import { OBSERVE, Observed, ObserveFn, OBSERVE_PROVIDER } from "ng-observe"; | |
import { map } from "rxjs/operators"; | |
@Component({ | |
template: ` | |
<div class="posts"> | |
<app-nav icon="prev" [link]="prev" [disabled]="!prev"></app-nav> |
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 { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy } from "@angular/core"; | |
import { ActivatedRoute } from "@angular/router"; | |
import { Subscription } from "rxjs"; | |
import { map, withLatestFrom } from "rxjs/operators"; | |
@Component({ | |
template: ` | |
<div class="posts"> | |
<app-nav icon="prev" [link]="prev" [disabled]="!prev"></app-nav> |
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, OnDestroy } from "@angular/core"; | |
import { ActivatedRoute } from "@angular/router"; | |
import { Subscription } from "rxjs"; | |
import { map, withLatestFrom } from "rxjs/operators"; | |
@Component({ | |
template: ` | |
<div class="posts"> | |
<app-nav icon="prev" [link]="prev" [disabled]="!prev"></app-nav> |
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 } from "@angular/core"; | |
import { ActivatedRoute } from "@angular/router"; | |
import { Subscription } from "rxjs"; | |
import { map, withLatestFrom } from "rxjs/operators"; | |
@Component({ | |
template: ` | |
<div class="posts"> | |
<app-nav icon="prev" [link]="prev" [disabled]="!prev"></app-nav> |
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
/* | |
* Unicode escape sequences & code point escapes | |
* can be used as identifiers in JavaScript... | |
*/ | |
const obj1 = { x: 'x' } | |
console.log( obj1.\u0078 ) // 'x' | |
const obj2 = { x: 'still x' } | |
console.log( obj2.\u{78} ) // 'still x' |
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
let foo, bar, baz; | |
[ foo, bar, baz ] = ['foo', 'bar', 'baz']; | |
console.log(foo, bar, baz); // "foo", "bar", "baz" | |
({ foo, bar, baz } = {bar: 'foo', baz: 'bar', foo: 'baz'}); | |
console.log(foo, bar, baz); // "baz", "foo", "bar" |
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
// other imports are removed for brevity | |
import { FooModule } from "./foo.module"; | |
@NgModule({ | |
imports: [ | |
BrowserModule, | |
RouterModule.forRoot([ | |
{ | |
path: "", | |
loadChildren: () => FooModule.asChild("bar"), |
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
@NgModule({ | |
imports: [ | |
BrowserModule, | |
RouterModule.forRoot([ | |
{ | |
path: "", | |
loadChildren: () => | |
import("./foo.module").then(m => m.FooModule.asChild("bar")) | |
} | |
]) |
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
// other imports are removed for brevity | |
import { NgModuleFactory } from "@angular/core"; | |
import { ChildModuleFactory } from "./child-module-factory"; | |
@NgModule(/* module metadata is removed for brevity */) | |
export class FooModule { | |
static withOptions(foo = "foo"): ModuleWithProviders<FooModule> { | |
return { | |
ngModule: FooModule, | |
providers: [ |