feat: camelCase Angular (kebab-case removal)
BREAKING CHANGE:
Angular is now fully camel case.
Before:
<p *ng-if="cond">
<my-cmp [my-prop]="exp">
<my-cmp (my-event)="action()">
<my-cmp [(my-prop)]="prop">
<input #my-input>
<template ng-for #my-item [ng-for-of]=items #my-index="index">
After
<p *ngIf="cond">
<my-cmp [myProp]="exp">
<my-cmp (myEvent)="action()">
<my-cmp [(myProp)]="prop">
<input #myInput>`,
<template ngFor="#my-item" [ngForOf]=items #myIndex="index">
The full details are found in [angular2/docs/migration/kebab-case.md](https://github.com/angular/angular/blob/master/modules/angular2/docs/migration/kebab-case.md)
This commit is contained in:
committed by
Igor Minar
parent
b386d1134a
commit
da9b46a071
@@ -22,7 +22,7 @@ export class SlicePipeStringExample {
|
||||
@Component({
|
||||
selector: 'slice-list-example',
|
||||
template: `<div>
|
||||
<li *ng-for="var i of collection | slice:1:3">{{i}}</li>
|
||||
<li *ngFor="var i of collection | slice:1:3">{{i}}</li>
|
||||
</div>`
|
||||
})
|
||||
export class SlicePipeListExample {
|
||||
@@ -33,7 +33,7 @@ export class SlicePipeListExample {
|
||||
@Component({
|
||||
selector: 'example-app',
|
||||
directives: [SlicePipeListExample, SlicePipeStringExample],
|
||||
template: `
|
||||
template: `
|
||||
<h1>SlicePipe Examples</h1>
|
||||
<slice-list-example></slice-list-example>
|
||||
<slice-string-example></slice-string-example>
|
||||
|
||||
@@ -24,8 +24,8 @@ class ControlPanelCmp {
|
||||
template: `
|
||||
<h1>Welcome Home!</h1>
|
||||
<div>
|
||||
Edit <a [router-link]="['/ControlPanelCmp', {id: 1}]" id="user-1-link">User 1</a> |
|
||||
Edit <a [router-link]="['/ControlPanelCmp', {id: 2}]" id="user-2-link">User 2</a>
|
||||
Edit <a [routerLink]="['/ControlPanelCmp', {id: 1}]" id="user-1-link">User 1</a> |
|
||||
Edit <a [routerLink]="['/ControlPanelCmp', {id: 2}]" id="user-2-link">User 2</a>
|
||||
</div>
|
||||
`,
|
||||
directives: [ROUTER_DIRECTIVES]
|
||||
|
||||
@@ -34,8 +34,8 @@ class NoteCmp implements CanDeactivate {
|
||||
template: `
|
||||
<h1>Your Notes</h1>
|
||||
<div>
|
||||
Edit <a [router-link]="['/NoteCmp', {id: 1}]" id="note-1-link">Note 1</a> |
|
||||
Edit <a [router-link]="['/NoteCmp', {id: 2}]" id="note-2-link">Note 2</a>
|
||||
Edit <a [routerLink]="['/NoteCmp', {id: 1}]" id="note-1-link">Note 1</a> |
|
||||
Edit <a [routerLink]="['/NoteCmp', {id: 2}]" id="note-2-link">Note 2</a>
|
||||
</div>
|
||||
`,
|
||||
directives: [ROUTER_DIRECTIVES]
|
||||
|
||||
@@ -25,8 +25,8 @@ class MyCmp implements OnActivate {
|
||||
template: `
|
||||
<h1>My App</h1>
|
||||
<nav>
|
||||
<a [router-link]="['/HomeCmp']" id="home-link">Navigate Home</a> |
|
||||
<a [router-link]="['/ParamCmp', {param: 1}]" id="param-link">Navigate with a Param</a>
|
||||
<a [routerLink]="['/HomeCmp']" id="home-link">Navigate Home</a> |
|
||||
<a [routerLink]="['/ParamCmp', {param: 1}]" id="param-link">Navigate with a Param</a>
|
||||
</nav>
|
||||
<router-outlet></router-outlet>
|
||||
`,
|
||||
|
||||
@@ -34,13 +34,13 @@ class MyCmp implements OnDeactivate {
|
||||
template: `
|
||||
<h1>My App</h1>
|
||||
<nav>
|
||||
<a [router-link]="['/HomeCmp']" id="home-link">Navigate Home</a> |
|
||||
<a [router-link]="['/ParamCmp', {param: 1}]" id="param-link">Navigate with a Param</a>
|
||||
<a [routerLink]="['/HomeCmp']" id="home-link">Navigate Home</a> |
|
||||
<a [routerLink]="['/ParamCmp', {param: 1}]" id="param-link">Navigate with a Param</a>
|
||||
</nav>
|
||||
<router-outlet></router-outlet>
|
||||
<div id="log">
|
||||
<h2>Log:</h2>
|
||||
<p *ng-for="#logItem of logService.logs">{{ logItem }}</p>
|
||||
<p *ngFor="#logItem of logService.logs">{{ logItem }}</p>
|
||||
</div>
|
||||
`,
|
||||
directives: [ROUTER_DIRECTIVES, NgFor]
|
||||
|
||||
@@ -37,8 +37,8 @@ class MyCmp implements CanReuse,
|
||||
selector: 'example-app',
|
||||
template: `
|
||||
<h1>Say hi to...</h1>
|
||||
<a [router-link]="['/HomeCmp', {name: 'naomi'}]" id="naomi-link">Naomi</a> |
|
||||
<a [router-link]="['/HomeCmp', {name: 'brad'}]" id="brad-link">Brad</a>
|
||||
<a [routerLink]="['/HomeCmp', {name: 'naomi'}]" id="naomi-link">Naomi</a> |
|
||||
<a [routerLink]="['/HomeCmp', {name: 'brad'}]" id="brad-link">Brad</a>
|
||||
<router-outlet></router-outlet>
|
||||
`,
|
||||
directives: [ROUTER_DIRECTIVES]
|
||||
|
||||
Reference in New Issue
Block a user