From b0a7bc77ee87f27a8b577ba44cf84bbea7246a3e Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Sun, 19 Mar 2017 17:56:54 +0000 Subject: [PATCH] build(aio): remove cheatsheet processing and content This will be replaced by a single file migrated from angular.io --- aio/content/cheatsheet/bootstrapping.md | 18 -- aio/content/cheatsheet/built-in-directives.md | 34 ---- aio/content/cheatsheet/class-decorators.md | 49 ----- .../cheatsheet/component-configuration.md | 38 ---- .../cheatsheet/dependency-injection.md | 30 ---- .../directive-and-component-decorators.md | 86 --------- .../cheatsheet/directive-configuration.md | 23 --- aio/content/cheatsheet/forms.md | 12 -- aio/content/cheatsheet/lifecycle hooks.md | 86 --------- aio/content/cheatsheet/ngmodules.md | 58 ------ aio/content/cheatsheet/routing.md | 170 ------------------ aio/content/cheatsheet/template-syntax.md | 94 ---------- aio/transforms/angular.io-package/index.js | 10 +- aio/transforms/cheatsheet-package/index.js | 16 -- .../processors/createCheatsheetDoc.js | 48 ----- .../services/cheatsheetItemParser.js | 125 ------------- .../services/cheatsheetItemParser.spec.js | 75 -------- .../tag-defs/cheatsheet-index.js | 14 -- .../tag-defs/cheatsheet-item.js | 15 -- .../tag-defs/cheatsheet-section.js | 10 -- .../cheatsheet-package/tag-defs/index.js | 2 - 21 files changed, 2 insertions(+), 1011 deletions(-) delete mode 100644 aio/content/cheatsheet/bootstrapping.md delete mode 100644 aio/content/cheatsheet/built-in-directives.md delete mode 100644 aio/content/cheatsheet/class-decorators.md delete mode 100644 aio/content/cheatsheet/component-configuration.md delete mode 100644 aio/content/cheatsheet/dependency-injection.md delete mode 100644 aio/content/cheatsheet/directive-and-component-decorators.md delete mode 100644 aio/content/cheatsheet/directive-configuration.md delete mode 100644 aio/content/cheatsheet/forms.md delete mode 100644 aio/content/cheatsheet/lifecycle hooks.md delete mode 100644 aio/content/cheatsheet/ngmodules.md delete mode 100644 aio/content/cheatsheet/routing.md delete mode 100644 aio/content/cheatsheet/template-syntax.md delete mode 100644 aio/transforms/cheatsheet-package/index.js delete mode 100644 aio/transforms/cheatsheet-package/processors/createCheatsheetDoc.js delete mode 100644 aio/transforms/cheatsheet-package/services/cheatsheetItemParser.js delete mode 100644 aio/transforms/cheatsheet-package/services/cheatsheetItemParser.spec.js delete mode 100644 aio/transforms/cheatsheet-package/tag-defs/cheatsheet-index.js delete mode 100644 aio/transforms/cheatsheet-package/tag-defs/cheatsheet-item.js delete mode 100644 aio/transforms/cheatsheet-package/tag-defs/cheatsheet-section.js delete mode 100644 aio/transforms/cheatsheet-package/tag-defs/index.js diff --git a/aio/content/cheatsheet/bootstrapping.md b/aio/content/cheatsheet/bootstrapping.md deleted file mode 100644 index 37fc40ff22..0000000000 --- a/aio/content/cheatsheet/bootstrapping.md +++ /dev/null @@ -1,18 +0,0 @@ -@cheatsheetSection -Bootstrapping -@cheatsheetIndex 0 -@description -{@target ts}`import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';`{@endtarget} -{@target js}Available from the `ng.platformBrowserDynamic` namespace{@endtarget} - -@cheatsheetItem -syntax(ts): -`platformBrowserDynamic().bootstrapModule(AppModule);`|`platformBrowserDynamic().bootstrapModule` -syntax(js): -`document.addEventListener('DOMContentLoaded', function() { - ng.platformBrowserDynamic - .platformBrowserDynamic() - .bootstrapModule(app.AppModule); -});`|`platformBrowserDynamic().bootstrapModule` -description: -Bootstraps the app, using the root component from the specified `NgModule`. {@target js}Must be wrapped in the event listener to fire when the page loads.{@endtarget} diff --git a/aio/content/cheatsheet/built-in-directives.md b/aio/content/cheatsheet/built-in-directives.md deleted file mode 100644 index d82be6a129..0000000000 --- a/aio/content/cheatsheet/built-in-directives.md +++ /dev/null @@ -1,34 +0,0 @@ -@cheatsheetSection -Built-in directives -@cheatsheetIndex 3 -@description -{@target ts}`import { CommonModule } from '@angular/common';`{@endtarget} -{@target js}Available using the `ng.common.CommonModule` module{@endtarget} - -@cheatsheetItem -syntax: -`
`|`*ngIf` -description: -Removes or recreates a portion of the DOM tree based on the `showSection` expression. - -@cheatsheetItem -syntax: -`
  • `|`*ngFor` -description: -Turns the li element and its contents into a template, and uses that to instantiate a view for each item in list. - -@cheatsheetItem -syntax: -`
    - ... - ... - ... -
    `|`[ngSwitch]`|`[ngSwitchCase]`|`ngSwitchCase`|`ngSwitchDefault` -description: -Conditionally swaps the contents of the div by selecting one of the embedded templates based on the current value of `conditionExpression`. - -@cheatsheetItem -syntax: -`
    `|`[ngClass]` -description: -Binds the presence of CSS classes on the element to the truthiness of the associated map values. The right-hand expression should return {class-name: true/false} map. diff --git a/aio/content/cheatsheet/class-decorators.md b/aio/content/cheatsheet/class-decorators.md deleted file mode 100644 index 4fb891c505..0000000000 --- a/aio/content/cheatsheet/class-decorators.md +++ /dev/null @@ -1,49 +0,0 @@ -@cheatsheetSection -Class decorators -@cheatsheetIndex 5 -@description -{@target ts}`import { Directive, ... } from '@angular/core';`{@endtarget} -{@target js}Available from the `ng.core` namespace{@endtarget} - -@cheatsheetItem -syntax(ts): -`@Component({...}) -class MyComponent() {}`|`@Component({...})` -syntax(js): -`var MyComponent = ng.core.Component({...}).Class({...})`|`ng.core.Component({...})` -description: -Declares that a class is a component and provides metadata about the component. - -@cheatsheetItem -syntax(ts): -`@Directive({...}) -class MyDirective() {}`|`@Directive({...})` -syntax(js): -`var MyDirective = ng.core.Directive({...}).Class({...})`|`ng.core.Directive({...})` -description: -Declares that a class is a directive and provides metadata about the directive. - -@cheatsheetItem -syntax(ts): -`@Pipe({...}) -class MyPipe() {}`|`@Pipe({...})` -syntax(js): -`var MyPipe = ng.core.Pipe({...}).Class({...})`|`ng.core.Pipe({...})` -description: -Declares that a class is a pipe and provides metadata about the pipe. - -@cheatsheetItem -syntax(ts): -`@Injectable() -class MyService() {}`|`@Injectable()` -syntax(js): -`var OtherService = ng.core.Class( - {constructor: function() { }}); -var MyService = ng.core.Class( - {constructor: [OtherService, function(otherService) { }]});`|`var MyService = ng.core.Class({constructor: [OtherService, function(otherService) { }]});` -description: -{@target ts}Declares that a class has dependencies that should be injected into the constructor when the dependency injector is creating an instance of this class. -{@endtarget} -{@target js} -Declares a service to inject into a class by providing an array with the services, with the final item being the function to receive the injected services. -{@endtarget} diff --git a/aio/content/cheatsheet/component-configuration.md b/aio/content/cheatsheet/component-configuration.md deleted file mode 100644 index 01e64c60e4..0000000000 --- a/aio/content/cheatsheet/component-configuration.md +++ /dev/null @@ -1,38 +0,0 @@ -@cheatsheetSection -Component configuration -@cheatsheetIndex 7 -@description -{@target js}`ng.core.Component` extends `ng.core.Directive`, -so the `ng.core.Directive` configuration applies to components as well{@endtarget} -{@target ts}`@Component` extends `@Directive`, -so the `@Directive` configuration applies to components as well{@endtarget} - -@cheatsheetItem -syntax: -`moduleId: module.id`|`moduleId:` -description: -If set, the `templateUrl` and `styleUrl` are resolved relative to the component. - -@cheatsheetItem -syntax(ts): -`viewProviders: [MyService, { provide: ... }]`|`viewProviders:` -syntax(js): -`viewProviders: [MyService, { provide: ... }]`|`viewProviders:` -description: -List of dependency injection providers scoped to this component's view. - - -@cheatsheetItem -syntax: -`template: 'Hello {{name}}' -templateUrl: 'my-component.html'`|`template:`|`templateUrl:` -description: -Inline template or external template URL of the component's view. - - -@cheatsheetItem -syntax: -`styles: ['.primary {color: red}'] -styleUrls: ['my-component.css']`|`styles:`|`styleUrls:` -description: -List of inline CSS styles or external stylesheet URLs for styling the component’s view. diff --git a/aio/content/cheatsheet/dependency-injection.md b/aio/content/cheatsheet/dependency-injection.md deleted file mode 100644 index 08efffe154..0000000000 --- a/aio/content/cheatsheet/dependency-injection.md +++ /dev/null @@ -1,30 +0,0 @@ -@cheatsheetSection -Dependency injection configuration -@cheatsheetIndex 10 -@description - -@cheatsheetItem -syntax(ts): -`{ provide: MyService, useClass: MyMockService }`|`provide`|`useClass` -syntax(js): -`{ provide: MyService, useClass: MyMockService }`|`provide`|`useClass` -description: -Sets or overrides the provider for `MyService` to the `MyMockService` class. - - -@cheatsheetItem -syntax(ts): -`{ provide: MyService, useFactory: myFactory }`|`provide`|`useFactory` -syntax(js): -`{ provide: MyService, useFactory: myFactory }`|`provide`|`useFactory` -description: -Sets or overrides the provider for `MyService` to the `myFactory` factory function. - - -@cheatsheetItem -syntax(ts): -`{ provide: MyValue, useValue: 41 }`|`provide`|`useValue` -syntax(js): -`{ provide: MyValue, useValue: 41 }`|`provide`|`useValue` -description: -Sets or overrides the provider for `MyValue` to the value `41`. diff --git a/aio/content/cheatsheet/directive-and-component-decorators.md b/aio/content/cheatsheet/directive-and-component-decorators.md deleted file mode 100644 index be6d2dc711..0000000000 --- a/aio/content/cheatsheet/directive-and-component-decorators.md +++ /dev/null @@ -1,86 +0,0 @@ -@cheatsheetSection -Class field decorators for directives and components -@cheatsheetIndex 8 -@description -{@target ts}`import { Input, ... } from '@angular/core';`{@endtarget} -{@target js}Available from the `ng.core` namespace{@endtarget} - -@cheatsheetItem -syntax(ts): -`@Input() myProperty;`|`@Input()` -syntax(js): -`ng.core.Input(myProperty, myComponent);`|`ng.core.Input(`|`);` -description: -Declares an input property that you can update via property binding (example: -``). - - -@cheatsheetItem -syntax(ts): -`@Output() myEvent = new EventEmitter();`|`@Output()` -syntax(js): -`myEvent = new ng.core.EventEmitter(); -ng.core.Output(myEvent, myComponent);`|`ng.core.Output(`|`);` -description: -Declares an output property that fires events that you can subscribe to with an event binding (example: ``). - - -@cheatsheetItem -syntax(ts): -`@HostBinding('class.valid') isValid;`|`@HostBinding('class.valid')` -syntax(js): -`ng.core.HostBinding('class.valid', - 'isValid', myComponent);`|`ng.core.HostBinding('class.valid', 'isValid'`|`);` -description: -Binds a host element property (here, the CSS class `valid`) to a directive/component property (`isValid`). - - - -@cheatsheetItem -syntax(ts): -`@HostListener('click', ['$event']) onClick(e) {...}`|`@HostListener('click', ['$event'])` -syntax(js): -`ng.core.HostListener('click', - ['$event'], onClick(e) {...}, myComponent);`|`ng.core.HostListener('click', ['$event'], onClick(e)`|`);` -description: -Subscribes to a host element event (`click`) with a directive/component method (`onClick`), optionally passing an argument (`$event`). - - -@cheatsheetItem -syntax(ts): -`@ContentChild(myPredicate) myChildComponent;`|`@ContentChild(myPredicate)` -syntax(js): -`ng.core.ContentChild(myPredicate, - 'myChildComponent', myComponent);`|`ng.core.ContentChild(myPredicate,`|`);` -description: -Binds the first result of the component content query (`myPredicate`) to a property (`myChildComponent`) of the class. - - -@cheatsheetItem -syntax(ts): -`@ContentChildren(myPredicate) myChildComponents;`|`@ContentChildren(myPredicate)` -syntax(js): -`ng.core.ContentChildren(myPredicate, - 'myChildComponents', myComponent);`|`ng.core.ContentChildren(myPredicate,`|`);` -description: -Binds the results of the component content query (`myPredicate`) to a property (`myChildComponents`) of the class. - - -@cheatsheetItem -syntax(ts): -`@ViewChild(myPredicate) myChildComponent;`|`@ViewChild(myPredicate)` -syntax(js): -`ng.core.ViewChild(myPredicate, - 'myChildComponent', myComponent);`|`ng.core.ViewChild(myPredicate,`|`);` -description: -Binds the first result of the component view query (`myPredicate`) to a property (`myChildComponent`) of the class. Not available for directives. - - -@cheatsheetItem -syntax(ts): -`@ViewChildren(myPredicate) myChildComponents;`|`@ViewChildren(myPredicate)` -syntax(js): -`ng.core.ViewChildren(myPredicate, - 'myChildComponents', myComponent);`|`ng.core.ViewChildren(myPredicate,`|`);` -description: -Binds the results of the component view query (`myPredicate`) to a property (`myChildComponents`) of the class. Not available for directives. diff --git a/aio/content/cheatsheet/directive-configuration.md b/aio/content/cheatsheet/directive-configuration.md deleted file mode 100644 index 21a6e2ccbb..0000000000 --- a/aio/content/cheatsheet/directive-configuration.md +++ /dev/null @@ -1,23 +0,0 @@ -@cheatsheetSection -Directive configuration -@cheatsheetIndex 6 -@description -{@target ts}`@Directive({ property1: value1, ... })`{@endtarget} -{@target js}`ng.core.Directive({ property1: value1, ... }).Class({...})`{@endtarget} - -@cheatsheetItem -syntax: -`selector: '.cool-button:not(a)'`|`selector:` -description: -Specifies a CSS selector that identifies this directive within a template. Supported selectors include `element`, -`[attribute]`, `.class`, and `:not()`. - -Does not support parent-child relationship selectors. - -@cheatsheetItem -syntax(ts): -`providers: [MyService, { provide: ... }]`|`providers:` -syntax(js): -`providers: [MyService, { provide: ... }]`|`providers:` -description: -List of dependency injection providers for this directive and its children. diff --git a/aio/content/cheatsheet/forms.md b/aio/content/cheatsheet/forms.md deleted file mode 100644 index ed7cc367e7..0000000000 --- a/aio/content/cheatsheet/forms.md +++ /dev/null @@ -1,12 +0,0 @@ -@cheatsheetSection -Forms -@cheatsheetIndex 4 -@description -{@target ts}`import { FormsModule } from '@angular/forms';`{@endtarget} -{@target js}Available using the `ng.forms.FormsModule` module{@endtarget} - -@cheatsheetItem -syntax: -``|`[(ngModel)]` -description: -Provides two-way data-binding, parsing, and validation for form controls. diff --git a/aio/content/cheatsheet/lifecycle hooks.md b/aio/content/cheatsheet/lifecycle hooks.md deleted file mode 100644 index 8e15e809ba..0000000000 --- a/aio/content/cheatsheet/lifecycle hooks.md +++ /dev/null @@ -1,86 +0,0 @@ -@cheatsheetSection -Directive and component change detection and lifecycle hooks -@cheatsheetIndex 9 -@description -{@target ts}(implemented as class methods){@endtarget} -{@target js}(implemented as component properties){@endtarget} - -@cheatsheetItem -syntax(ts): -`constructor(myService: MyService, ...) { ... }`|`constructor(myService: MyService, ...)` -syntax(js): -`constructor: function(MyService, ...) { ... }`|`constructor: function(MyService, ...)` -description: -Called before any other lifecycle hook. Use it to inject dependencies, but avoid any serious work here. - - -@cheatsheetItem -syntax(ts): -`ngOnChanges(changeRecord) { ... }`|`ngOnChanges(changeRecord)` -syntax(js): -`ngOnChanges: function(changeRecord) { ... }`|`ngOnChanges: function(changeRecord)` -description: -Called after every change to input properties and before processing content or child views. - - -@cheatsheetItem -syntax(ts): -`ngOnInit() { ... }`|`ngOnInit()` -syntax(js): -`ngOnInit: function() { ... }`|`ngOnInit: function()` -description: -Called after the constructor, initializing input properties, and the first call to `ngOnChanges`. - - -@cheatsheetItem -syntax(ts): -`ngDoCheck() { ... }`|`ngDoCheck()` -syntax(js): -`ngDoCheck: function() { ... }`|`ngDoCheck: function()` -description: -Called every time that the input properties of a component or a directive are checked. Use it to extend change detection by performing a custom check. - - -@cheatsheetItem -syntax(ts): -`ngAfterContentInit() { ... }`|`ngAfterContentInit()` -syntax(js): -`ngAfterContentInit: function() { ... }`|`ngAfterContentInit: function()` -description: -Called after `ngOnInit` when the component's or directive's content has been initialized. - - -@cheatsheetItem -syntax(ts): -`ngAfterContentChecked() { ... }`|`ngAfterContentChecked()` -syntax(js): -`ngAfterContentChecked: function() { ... }`|`ngAfterContentChecked: function()` -description: -Called after every check of the component's or directive's content. - - -@cheatsheetItem -syntax(ts): -`ngAfterViewInit() { ... }`|`ngAfterViewInit()` -syntax(js): -`ngAfterViewInit: function() { ... }`|`ngAfterViewInit: function()` -description: -Called after `ngAfterContentInit` when the component's view has been initialized. Applies to components only. - - -@cheatsheetItem -syntax(ts): -`ngAfterViewChecked() { ... }`|`ngAfterViewChecked()` -syntax(js): -`ngAfterViewChecked: function() { ... }`|`ngAfterViewChecked: function()` -description: -Called after every check of the component's view. Applies to components only. - - -@cheatsheetItem -syntax(ts): -`ngOnDestroy() { ... }`|`ngOnDestroy()` -syntax(js): -`ngOnDestroy: function() { ... }`|`ngOnDestroy: function()` -description: -Called once, before the instance is destroyed. diff --git a/aio/content/cheatsheet/ngmodules.md b/aio/content/cheatsheet/ngmodules.md deleted file mode 100644 index d55972ee9a..0000000000 --- a/aio/content/cheatsheet/ngmodules.md +++ /dev/null @@ -1,58 +0,0 @@ -@cheatsheetSection -NgModules -@cheatsheetIndex 1 -@description -{@target ts}`import { NgModule } from '@angular/core';`{@endtarget} -{@target js}Available from the `ng.core` namespace{@endtarget} - -@cheatsheetItem -syntax(ts): -`@NgModule({ declarations: ..., imports: ..., - exports: ..., providers: ..., bootstrap: ...}) -class MyModule {}`|`NgModule` -description: -Defines a module that contains components, directives, pipes, and providers. - -syntax(js): -`ng.core.NgModule({declarations: ..., imports: ..., - exports: ..., providers: ..., bootstrap: ...}). -Class({ constructor: function() {}})` -description: -Defines a module that contains components, directives, pipes, and providers. - -@cheatsheetItem -syntax: -`declarations: [MyRedComponent, MyBlueComponent, MyDatePipe]`|`declarations:` -description: -List of components, directives, and pipes that belong to this module. - -@cheatsheetItem -syntax(ts): -`imports: [BrowserModule, SomeOtherModule]`|`imports:` -description: -List of modules to import into this module. Everything from the imported modules -is available to `declarations` of this module. - -syntax(js): -`imports: [ng.platformBrowser.BrowserModule, SomeOtherModule]`|`imports:` -description: -List of modules to import into this module. Everything from the imported modules -is available to `declarations` of this module. - -@cheatsheetItem -syntax: -`exports: [MyRedComponent, MyDatePipe]`|`exports:` -description: -List of components, directives, and pipes visible to modules that import this module. - -@cheatsheetItem -syntax: -`providers: [MyService, { provide: ... }]`|`providers:` -description: -List of dependency injection providers visible both to the contents of this module and to importers of this module. - -@cheatsheetItem -syntax: -`bootstrap: [MyAppComponent]`|`bootstrap:` -description: -List of components to bootstrap when this module is bootstrapped. diff --git a/aio/content/cheatsheet/routing.md b/aio/content/cheatsheet/routing.md deleted file mode 100644 index 74f21d52a1..0000000000 --- a/aio/content/cheatsheet/routing.md +++ /dev/null @@ -1,170 +0,0 @@ -@cheatsheetSection -Routing and navigation -@cheatsheetIndex 11 -@description -{@target ts}`import { Routes, RouterModule, ... } from '@angular/router';`{@endtarget} -{@target js}Available from the `ng.router` namespace{@endtarget} - - -@cheatsheetItem -syntax(ts): -`const routes: Routes = [ - { path: '', component: HomeComponent }, - { path: 'path/:routeParam', component: MyComponent }, - { path: 'staticPath', component: ... }, - { path: '**', component: ... }, - { path: 'oldPath', redirectTo: '/staticPath' }, - { path: ..., component: ..., data: { message: 'Custom' } } -]); - -const routing = RouterModule.forRoot(routes);`|`Routes` -syntax(js): -`var routes = [ - { path: '', component: HomeComponent }, - { path: ':routeParam', component: MyComponent }, - { path: 'staticPath', component: ... }, - { path: '**', component: ... }, - { path: 'oldPath', redirectTo: '/staticPath' }, - { path: ..., component: ..., data: { message: 'Custom' } } -]); - -var routing = ng.router.RouterModule.forRoot(routes);`|`ng.router.Routes` -description: -Configures routes for the application. Supports static, parameterized, redirect, and wildcard routes. Also supports custom route data and resolve. - - -@cheatsheetItem -syntax: -` - - -`|`router-outlet` -description: -Marks the location to load the component of the active route. - - -@cheatsheetItem -syntax: -` - - - - - -`|`[routerLink]` -description: -Creates a link to a different view based on a route instruction consisting of a route path, required and optional parameters, query parameters, and a fragment. To navigate to a root route, use the `/` prefix; for a child route, use the `./`prefix; for a sibling or parent, use the `../` prefix. - -@cheatsheetItem -syntax: -`` -description: -The provided classes are added to the element when the `routerLink` becomes the current active route. - -@cheatsheetItem -syntax(ts): -`class CanActivateGuard implements CanActivate { - canActivate( - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot - ): Observable|Promise|boolean { ... } -} - -{ path: ..., canActivate: [CanActivateGuard] }`|`CanActivate` -syntax(js): -`var CanActivateGuard = ng.core.Class({ - canActivate: function(route, state) { - // return Observable/Promise boolean or boolean - } -}); - -{ path: ..., canActivate: [CanActivateGuard] }`|`CanActivate` -description: -An interface for defining a class that the router should call first to determine if it should activate this component. Should return a boolean or an Observable/Promise that resolves to a boolean. - -@cheatsheetItem -syntax(ts): -`class CanDeactivateGuard implements CanDeactivate { - canDeactivate( - component: T, - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot - ): Observable|Promise|boolean { ... } -} - -{ path: ..., canDeactivate: [CanDeactivateGuard] }`|`CanDeactivate` -syntax(js): -`var CanDeactivateGuard = ng.core.Class({ - canDeactivate: function(component, route, state) { - // return Observable/Promise boolean or boolean - } -}); - -{ path: ..., canDeactivate: [CanDeactivateGuard] }`|`CanDeactivate` -description: -An interface for defining a class that the router should call first to determine if it should deactivate this component after a navigation. Should return a boolean or an Observable/Promise that resolves to a boolean. - -@cheatsheetItem -syntax(ts): -`class CanActivateChildGuard implements CanActivateChild { - canActivateChild( - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot - ): Observable|Promise|boolean { ... } -} - -{ path: ..., canActivateChild: [CanActivateGuard], - children: ... }`|`CanActivateChild` -syntax(js): -`var CanActivateChildGuard = ng.core.Class({ - canActivateChild: function(route, state) { - // return Observable/Promise boolean or boolean - } -}); - -{ path: ..., canActivateChild: [CanActivateChildGuard], - children: ... }`|`CanActivateChild` -description: -An interface for defining a class that the router should call first to determine if it should activate the child route. Should return a boolean or an Observable/Promise that resolves to a boolean. - -@cheatsheetItem -syntax(ts): -`class ResolveGuard implements Resolve { - resolve( - route: ActivatedRouteSnapshot, - state: RouterStateSnapshot - ): Observable|Promise|any { ... } -} - -{ path: ..., resolve: [ResolveGuard] }`|`Resolve` -syntax(js): -`var ResolveGuard = ng.core.Class({ - resolve: function(route, state) { - // return Observable/Promise value or value - } -}); - -{ path: ..., resolve: [ResolveGuard] }`|`Resolve` -description: -An interface for defining a class that the router should call first to resolve route data before rendering the route. Should return a value or an Observable/Promise that resolves to a value. - -@cheatsheetItem -syntax(ts): -`class CanLoadGuard implements CanLoad { - canLoad( - route: Route - ): Observable|Promise|boolean { ... } -} - -{ path: ..., canLoad: [CanLoadGuard], loadChildren: ... }`|`CanLoad` -syntax(js): -`var CanLoadGuard = ng.core.Class({ - canLoad: function(route) { - // return Observable/Promise boolean or boolean - } -}); - -{ path: ..., canLoad: [CanLoadGuard], loadChildren: ... }`|`CanLoad` -description: -An interface for defining a class that the router should call first to check if the lazy loaded module should be loaded. Should return a boolean or an Observable/Promise that resolves to a boolean. - diff --git a/aio/content/cheatsheet/template-syntax.md b/aio/content/cheatsheet/template-syntax.md deleted file mode 100644 index 1984273b4b..0000000000 --- a/aio/content/cheatsheet/template-syntax.md +++ /dev/null @@ -1,94 +0,0 @@ -@cheatsheetSection -Template syntax -@cheatsheetIndex 2 -@description - -@cheatsheetItem -syntax: -``|`[value]` -description: -Binds property `value` to the result of expression `firstName`. - -@cheatsheetItem -syntax: -`
    `|`[attr.role]` -description: -Binds attribute `role` to the result of expression `myAriaRole`. - -@cheatsheetItem -syntax: -`
    `|`[class.extra-sparkle]` -description: -Binds the presence of the CSS class `extra-sparkle` on the element to the truthiness of the expression `isDelightful`. - -@cheatsheetItem -syntax: -`
    `|`[style.width.px]` -description: -Binds style property `width` to the result of expression `mySize` in pixels. Units are optional. - -@cheatsheetItem -syntax: -`