remove all _fragment and js/latest/api files - these can all be created via build doc tasks
This commit is contained in:
parent
6f6e83722e
commit
b529a94cca
|
@ -1,14 +0,0 @@
|
|||
```
|
||||
var expectedMsg = 'My First Angular 2 App';
|
||||
|
||||
// tests shared across languages
|
||||
function sharedTests(basePath) {
|
||||
beforeEach(function () {
|
||||
browser.get(basePath + 'index.html');
|
||||
});
|
||||
|
||||
it('should display: ' + expectedMsg, function () {
|
||||
expect(element(by.id('output')).getText()).toEqual(expectedMsg);
|
||||
});
|
||||
}
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
```
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
ng.bootstrap(AppComponent);
|
||||
});
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
```
|
||||
var AppComponent = ng
|
||||
.Component({
|
||||
selector: 'my-app'
|
||||
})
|
||||
.View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
.Class({
|
||||
constructor: function () { }
|
||||
});
|
||||
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
```
|
||||
.Class({
|
||||
constructor: function () { }
|
||||
});
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
```
|
||||
.Component({
|
||||
selector: 'my-app'
|
||||
})
|
||||
```
|
|
@ -1,12 +0,0 @@
|
|||
```
|
||||
function AppComponent () {}
|
||||
|
||||
AppComponent.annotations = [
|
||||
new ng.ComponentAnnotation({
|
||||
selector: 'my-app'
|
||||
}),
|
||||
new ng.ViewAnnotation({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
];
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
```
|
||||
.View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
```
|
|
@ -1,17 +0,0 @@
|
|||
```
|
||||
var AppComponent = ng
|
||||
.Component({
|
||||
selector: 'my-app'
|
||||
})
|
||||
.View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
.Class({
|
||||
constructor: function () { }
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
ng.bootstrap(AppComponent);
|
||||
});
|
||||
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
```
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="https://code.angularjs.org/2.0.0-alpha.34/angular2.sfx.dev.js"></script>
|
||||
<script src="app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<my-app></my-app>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
```
|
|
@ -1,18 +0,0 @@
|
|||
```
|
||||
{
|
||||
"name": "ng2-getting-started",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"angular2": "2.0.0-alpha.35",
|
||||
"es6-module-loader": "^0.16",
|
||||
"systemjs": "^0.16",
|
||||
"traceur": "0.0.91"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "cd src && tsd reinstall -r -o && cd ..",
|
||||
"tsc": "tsc -p src -w",
|
||||
"start": "live-server --open=src"
|
||||
}
|
||||
}
|
||||
|
||||
```
|
|
@ -1,3 +0,0 @@
|
|||
```
|
||||
bootstrap(AppComponent);
|
||||
```
|
|
@ -1,10 +0,0 @@
|
|||
```
|
||||
@Component({
|
||||
selector: 'my-app'
|
||||
})
|
||||
@View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
class AppComponent { }
|
||||
|
||||
```
|
|
@ -1,3 +0,0 @@
|
|||
```
|
||||
class AppComponent { }
|
||||
```
|
|
@ -1,3 +0,0 @@
|
|||
```
|
||||
import {Component, View, bootstrap} from 'angular2/angular2';
|
||||
```
|
|
@ -1,14 +0,0 @@
|
|||
```
|
||||
import {Component, View, bootstrap} from 'angular2/angular2';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app'
|
||||
})
|
||||
@View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
class AppComponent { }
|
||||
|
||||
bootstrap(AppComponent);
|
||||
|
||||
```
|
|
@ -1,18 +0,0 @@
|
|||
```
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="../node_modules/traceur/bin/traceur-runtime.js"></script>
|
||||
<script src="../node_modules/es6-module-loader/dist/es6-module-loader.js"></script>
|
||||
<script src="../node_modules/systemjs/dist/system.src.js"></script>
|
||||
<script src="../node_modules/angular2/bundles/angular2.dev.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<my-app></my-app>
|
||||
<script>
|
||||
System.import('app');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
```
|
|
@ -1,11 +0,0 @@
|
|||
```
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES5",
|
||||
"module": "commonjs",
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,27 +0,0 @@
|
|||
```
|
||||
{
|
||||
"version": "v4",
|
||||
"repo": "borisyankov/DefinitelyTyped",
|
||||
"ref": "master",
|
||||
"path": "typings",
|
||||
"bundle": "typings/tsd.d.ts",
|
||||
"installed": {
|
||||
"angular2/angular2.d.ts": {
|
||||
"commit": "cd2e71bb1f0459197e733be66fdeafaec600514d"
|
||||
},
|
||||
"es6-promise/es6-promise.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
},
|
||||
"jasmine/jasmine.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
},
|
||||
"rx/rx.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
},
|
||||
"rx/rx-lite.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
|
@ -1,8 +0,0 @@
|
|||
```
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES5",
|
||||
"module": "commonjs"
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
```
|
||||
it('should display Alice', function() {
|
||||
expect(element(by.id('output')).getText()).toEqual('Hello Alice');
|
||||
});
|
||||
```
|
|
@ -1,7 +0,0 @@
|
|||
```
|
||||
<title>Angular 2 Quickstart</title>
|
||||
<script src="node_modules/traceur/bin/traceur-runtime.js"></script>
|
||||
<script src="node_modules/es6-module-loader/dist/es6-module-loader.js"></script>
|
||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
|
||||
```
|
|
@ -1,15 +0,0 @@
|
|||
```
|
||||
<html>
|
||||
<head>
|
||||
<title>Angular 2 Quickstart</title>
|
||||
<script src="node_modules/traceur/bin/traceur-runtime.js"></script>
|
||||
<script src="node_modules/es6-module-loader/dist/es6-module-loader.js"></script>
|
||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<app></app>
|
||||
<script>System.import('src/app');</script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
|
@ -1,23 +0,0 @@
|
|||
```
|
||||
{
|
||||
"name": "ng2-quickstart",
|
||||
"version": "0.0.1",
|
||||
"license": "ICS",
|
||||
"repository": {},
|
||||
"dependencies": {
|
||||
"angular2": "2.0.0-alpha.35",
|
||||
"es6-module-loader": "^0.16",
|
||||
"systemjs": "^0.16",
|
||||
"traceur": "0.0.91"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jasmine-core": "^2.3.4",
|
||||
"zone.js": "^0.5.3"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "cd src && tsd reinstall -r -o && cd ..",
|
||||
"tsc": "tsc -p src -w",
|
||||
"start": "live-server"
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,3 +0,0 @@
|
|||
```
|
||||
bootstrap(AppComponent);
|
||||
```
|
|
@ -1,3 +0,0 @@
|
|||
```
|
||||
import {Component, View, bootstrap} from 'angular2/angular2';
|
||||
```
|
|
@ -1,20 +0,0 @@
|
|||
```
|
||||
import {Component, View, bootstrap} from 'angular2/angular2';
|
||||
|
||||
@Component({
|
||||
selector: 'app'
|
||||
})
|
||||
@View({
|
||||
template: '<h1 id="output">Hello {{ name }}</h1>'
|
||||
})
|
||||
export class AppComponent {
|
||||
name : string;
|
||||
|
||||
constructor() {
|
||||
this.name = 'Alice';
|
||||
}
|
||||
}
|
||||
|
||||
bootstrap(AppComponent);
|
||||
|
||||
```
|
|
@ -1,11 +0,0 @@
|
|||
```
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES5",
|
||||
"module": "commonjs",
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,27 +0,0 @@
|
|||
```
|
||||
{
|
||||
"version": "v4",
|
||||
"repo": "borisyankov/DefinitelyTyped",
|
||||
"ref": "master",
|
||||
"path": "typings",
|
||||
"bundle": "typings/tsd.d.ts",
|
||||
"installed": {
|
||||
"angular2/angular2.d.ts": {
|
||||
"commit": "cd2e71bb1f0459197e733be66fdeafaec600514d"
|
||||
},
|
||||
"es6-promise/es6-promise.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
},
|
||||
"jasmine/jasmine.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
},
|
||||
"rx/rx.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
},
|
||||
"rx/rx-lite.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
|
@ -1,56 +0,0 @@
|
|||
```
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8">
|
||||
<title>QuickStart Tests</title>
|
||||
<link rel="stylesheet" href="node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
|
||||
|
||||
<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
|
||||
<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
|
||||
<script src="node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
|
||||
|
||||
<script src="node_modules/traceur/bin/traceur-runtime.js"></script>
|
||||
<script src="node_modules/es6-module-loader/dist/es6-module-loader.src.js"></script>
|
||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
|
||||
<script src="node_modules/angular2/bundles/http.dev.js"></script>
|
||||
<script src="node_modules/angular2/bundles/test_lib.dev.js"></script>
|
||||
<script src="node_modules/zone.js/dist/long-stack-trace-zone.js"></script>
|
||||
<script src="node_modules/zone.js/dist/jasmine-patch.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<app><!--placeholder--></app>
|
||||
<script>
|
||||
(function() {
|
||||
Error.stackTraceLimit=Infinity;
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 100;
|
||||
|
||||
var imports = [
|
||||
'src/dummy.spec',
|
||||
'src/app.spec',
|
||||
'@empty' // placeholder makes it easier to comment-out specs above
|
||||
].map(System.import.bind(System));
|
||||
|
||||
Promise.all(imports)
|
||||
.then( function() {
|
||||
// Must designate a BrowserDomAdapter or else DOM testing bombs
|
||||
// (e.g. when testing component and call `tcb.createAsync`) for lack of `DOM` object
|
||||
// Igor's recommended approach based on
|
||||
// https://github.com/angular/angular/blob/master/test-main.js
|
||||
//
|
||||
// TODO: BrowserDomAdapter should be exposed through 'angular2/test' instead
|
||||
var DomAdapterModule = System.get('angular2/src/dom/browser_adapter');
|
||||
if (DomAdapterModule) {
|
||||
DomAdapterModule.BrowserDomAdapter.makeCurrent();
|
||||
}
|
||||
})
|
||||
.then( function() { window.onload();} ) // re-execute Jasmine's buildup
|
||||
.catch( function(err) { console.log(err);} );
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
```
|
|
@ -1,14 +0,0 @@
|
|||
```
|
||||
var expectedMsg = 'My First Angular 2 App';
|
||||
|
||||
// tests shared across languages
|
||||
function sharedTests(basePath) {
|
||||
beforeEach(function () {
|
||||
browser.get(basePath + 'index.html');
|
||||
});
|
||||
|
||||
it('should display: '+ expectedMsg, function() {
|
||||
expect(element(by.id('output')).getText()).toEqual(expectedMsg);
|
||||
});
|
||||
}
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
```
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
ng.bootstrap(AppComponent);
|
||||
});
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
```
|
||||
var AppComponent = ng
|
||||
.Component({
|
||||
selector: 'my-app'
|
||||
})
|
||||
.View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
.Class({
|
||||
constructor: function () { }
|
||||
});
|
||||
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
```
|
||||
.Class({
|
||||
constructor: function () { }
|
||||
});
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
```
|
||||
.Component({
|
||||
selector: 'my-app'
|
||||
})
|
||||
```
|
|
@ -1,12 +0,0 @@
|
|||
```
|
||||
function AppComponent () {}
|
||||
|
||||
AppComponent.annotations = [
|
||||
new ng.ComponentAnnotation({
|
||||
selector: 'my-app'
|
||||
}),
|
||||
new ng.ViewAnnotation({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
];
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
```
|
||||
.View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
```
|
|
@ -1,17 +0,0 @@
|
|||
```
|
||||
var AppComponent = ng
|
||||
.Component({
|
||||
selector: 'my-app'
|
||||
})
|
||||
.View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
.Class({
|
||||
constructor: function () { }
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
ng.bootstrap(AppComponent);
|
||||
});
|
||||
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
```
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="https://code.angularjs.org/2.0.0-alpha.34/angular2.sfx.dev.js"></script>
|
||||
<script src="app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<my-app>foo2</my-app>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
```
|
|
@ -1,9 +0,0 @@
|
|||
```
|
||||
describe("Jasmine sample test", function() {
|
||||
|
||||
it("1+1 should be 2", function() {
|
||||
var result = 1 + 1;
|
||||
expect(result).toBe(2);
|
||||
});
|
||||
});
|
||||
```
|
|
@ -1,17 +0,0 @@
|
|||
```
|
||||
{
|
||||
"name": "ng2-getting-started",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"angular2": "2.0.0-alpha.35",
|
||||
"es6-module-loader": "^0.16",
|
||||
"systemjs": "^0.16",
|
||||
"traceur": "0.0.91"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "cd src && tsd reinstall -r -o && cd ..",
|
||||
"tsc": "tsc -p src -w",
|
||||
"start": "live-server --open=src"
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,3 +0,0 @@
|
|||
```
|
||||
angular2_1.bootstrap(AppComponent);
|
||||
```
|
|
@ -1,3 +0,0 @@
|
|||
```
|
||||
bootstrap(AppComponent);
|
||||
```
|
|
@ -1,16 +0,0 @@
|
|||
```
|
||||
var AppComponent = (function () {
|
||||
function AppComponent() {
|
||||
}
|
||||
AppComponent = __decorate([
|
||||
angular2_1.Component({
|
||||
selector: 'my-app'
|
||||
}),
|
||||
angular2_1.View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
}),
|
||||
__metadata('design:paramtypes', [])
|
||||
], AppComponent);
|
||||
return AppComponent;
|
||||
})();
|
||||
```
|
|
@ -1,10 +0,0 @@
|
|||
```
|
||||
@Component({
|
||||
selector: 'my-app'
|
||||
})
|
||||
@View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
class AppComponent { }
|
||||
|
||||
```
|
|
@ -1,3 +0,0 @@
|
|||
```
|
||||
class AppComponent { }
|
||||
```
|
|
@ -1,3 +0,0 @@
|
|||
```
|
||||
var angular2_1 = require('angular2/angular2');
|
||||
```
|
|
@ -1,3 +0,0 @@
|
|||
```
|
||||
import {Component, View, bootstrap} from 'angular2/angular2';
|
||||
```
|
|
@ -1,18 +0,0 @@
|
|||
```
|
||||
var angular2_1 = require('angular2/angular2');
|
||||
var AppComponent = (function () {
|
||||
function AppComponent() {
|
||||
}
|
||||
AppComponent = __decorate([
|
||||
angular2_1.Component({
|
||||
selector: 'my-app'
|
||||
}),
|
||||
angular2_1.View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
}),
|
||||
__metadata('design:paramtypes', [])
|
||||
], AppComponent);
|
||||
return AppComponent;
|
||||
})();
|
||||
|
||||
```
|
|
@ -1,14 +0,0 @@
|
|||
```
|
||||
import {Component, View, bootstrap} from 'angular2/angular2';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app'
|
||||
})
|
||||
@View({
|
||||
template: '<h1 id="output">My First Angular 2 App</h1>'
|
||||
})
|
||||
class AppComponent { }
|
||||
|
||||
bootstrap(AppComponent);
|
||||
|
||||
```
|
|
@ -1,17 +0,0 @@
|
|||
```
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="https://github.jspm.io/jmcriffey/bower-traceur-runtime@0.0.87/traceur-runtime.js"></script>
|
||||
<script src="https://jspm.io/system@0.16.js"></script>
|
||||
<script src="https://code.angularjs.org/2.0.0-alpha.34/angular2.dev.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<my-app></my-app>
|
||||
<script>
|
||||
System.import('app');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
```
|
|
@ -1,11 +0,0 @@
|
|||
```
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES5",
|
||||
"module": "commonjs",
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true
|
||||
}
|
||||
}
|
||||
```
|
|
@ -1,27 +0,0 @@
|
|||
```
|
||||
{
|
||||
"version": "v4",
|
||||
"repo": "borisyankov/DefinitelyTyped",
|
||||
"ref": "master",
|
||||
"path": "typings",
|
||||
"bundle": "typings/tsd.d.ts",
|
||||
"installed": {
|
||||
"angular2/angular2.d.ts": {
|
||||
"commit": "cd2e71bb1f0459197e733be66fdeafaec600514d"
|
||||
},
|
||||
"es6-promise/es6-promise.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
},
|
||||
"jasmine/jasmine.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
},
|
||||
"rx/rx.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
},
|
||||
"rx/rx-lite.d.ts": {
|
||||
"commit": "71d072b7354936b88d57c2029042d2da7c6ec0e7"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/application_tokens.ts#L26-L26">angular2/src/core/application_tokens.ts (line 26)</a>
|
||||
|
||||
:markdown
|
||||
An <a href='angular2/di/OpaqueToken'>OpaqueToken</a> representing the application root type in the <a href='Injector-class.html'><code>Injector</code></a>.
|
||||
|
||||
```
|
||||
@Component(...)
|
||||
@View(...)
|
||||
class MyApp {
|
||||
...
|
||||
}
|
||||
|
||||
bootstrap(MyApp).then((appRef:ApplicationRef) {
|
||||
expect(appRef.injector.get(appComponentTypeToken)).toEqual(MyApp);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/render/dom/dom_tokens.ts#L9-L9">angular2/src/core/render/dom/dom_tokens.ts (line 9)</a>
|
||||
|
||||
:markdown
|
||||
A unique id (string) for an angular application.
|
||||
|
||||
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/exceptions.ts#L28-L55">angular2/src/core/di/exceptions.ts (line 28)</a>
|
||||
|
||||
:markdown
|
||||
Base class for all errors arising from misconfigured bindings.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(injector: Injector, key: Key, constructResolvingMessage: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#message message
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#keys keys
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#injectors injectors
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#constructResolvingMessage constructResolvingMessage
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#addKey addKey
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
addKey(injector: Injector, key: Key)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#context context
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,235 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/model.ts#L38-L132">angular2/src/core/forms/model.ts (line 38)</a>
|
||||
|
||||
:markdown
|
||||
Omitting from external API doc as this is really an abstract internal concept.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(validator: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#validator validator
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#value value
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#status status
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#valid valid
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#errors errors
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#pristine pristine
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#dirty dirty
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#touched touched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#untouched untouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#valueChanges valueChanges
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#markAsTouched markAsTouched
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
markAsTouched()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#markAsDirty markAsDirty
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
markAsDirty({onlySelf}?: {onlySelf?: boolean})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#setParent setParent
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
setParent(parent: ControlGroup | ControlArray)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#updateValidity updateValidity
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
updateValidity({onlySelf}?: {onlySelf?: boolean})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#updateValueAndValidity updateValueAndValidity
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
updateValueAndValidity({onlySelf, emitEvent}?: {onlySelf?: boolean, emitEvent?: boolean})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#find find
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
find(path: Array<string | number>| string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#getError getError
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getError(errorCode: string, path?: string[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#hasError hasError
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
hasError(errorCode: string, path?: string[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/abstract_control_directive.ts#L1-L19">angular2/src/core/forms/directives/abstract_control_directive.ts (line 1)</a>
|
||||
|
||||
:markdown
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#control control
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#value value
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#valid valid
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#errors errors
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#pristine pristine
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#dirty dirty
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#touched touched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#untouched untouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/interfaces.ts#L125-L141">angular2/src/core/compiler/interfaces.ts (line 125)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when the bindings of all its content children have been checked (whether
|
||||
they have changed or not).
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component(...)
|
||||
class MyComponent implements AfterContentChecked {
|
||||
afterContentChecked(): void {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#afterContentChecked afterContentChecked
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterContentChecked()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/interfaces.ts#L109-L125">angular2/src/core/compiler/interfaces.ts (line 109)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when the bindings of all its content children have been checked the first
|
||||
time (whether they have changed or not).
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component(...)
|
||||
class MyComponent implements AfterContentInit {
|
||||
afterContentInit(): void {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#afterContentInit afterContentInit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterContentInit()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/interfaces.ts#L157-L173">angular2/src/core/compiler/interfaces.ts (line 157)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when the bindings of all its view children have been checked (whether they
|
||||
have changed or not).
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component(...)
|
||||
class MyComponent implements AfterViewChecked {
|
||||
afterViewChecked(): void {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#afterViewChecked afterViewChecked
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterViewChecked()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/interfaces.ts#L141-L157">angular2/src/core/compiler/interfaces.ts (line 141)</a>
|
||||
|
||||
:markdown
|
||||
Notify a directive when the bindings of all its view children have been checked the first time
|
||||
(whether they have changed or not).
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component(...)
|
||||
class MyComponent implements AfterViewInit {
|
||||
afterViewInit(): void {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#afterViewInit afterViewInit
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
afterViewInit()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/services/app_root_url.ts#L2-L25">angular2/src/core/services/app_root_url.ts (line 2)</a>
|
||||
|
||||
:markdown
|
||||
Specifies app root url for the application.
|
||||
|
||||
Used by the <a href='Compiler-interface.html'><code>Compiler</code></a> when resolving HTML and CSS template URLs.
|
||||
|
||||
This interface can be overridden by the application developer to create custom behavior.
|
||||
|
||||
See <a href='Compiler-interface.html'><code>Compiler</code></a>
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-sub-section
|
||||
h3.annotation Injectable
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Injectable()
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(value: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#value value
|
||||
|
||||
|
||||
:markdown
|
||||
Returns the base URL of the currently running application.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,269 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/view_manager.ts#L19-L379">angular2/src/core/compiler/view_manager.ts (line 19)</a>
|
||||
|
||||
:markdown
|
||||
Entry point for creating, moving views in the view hierarchy and destroying views.
|
||||
This manager contains all recursion and delegates to helper methods
|
||||
in AppViewManagerUtils and the Renderer, so unit tests get simpler.
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-sub-section
|
||||
h3.annotation Injectable
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Injectable()
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#getViewContainer getViewContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getViewContainer(location: ElementRef)
|
||||
|
||||
:markdown
|
||||
Returns a <a href='ViewContainerRef-interface.html'><code>ViewContainerRef</code></a> at the <a href='ElementRef-class.html'><code>ElementRef</code></a> location.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#getHostElement getHostElement
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getHostElement(hostViewRef: HostViewRef)
|
||||
|
||||
:markdown
|
||||
Return the first child element of the host element view.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#getNamedElementInComponentView getNamedElementInComponentView
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getNamedElementInComponentView(hostLocation: ElementRef, variableName: string)
|
||||
|
||||
:markdown
|
||||
Returns an ElementRef for the element with the given variable name
|
||||
in the current view.
|
||||
|
||||
- `hostLocation`: <a href='ElementRef-class.html'><code>ElementRef</code></a> of any element in the View which defines the scope of
|
||||
search.
|
||||
- `variableName`: Name of the variable to locate.
|
||||
- Returns <a href='ElementRef-class.html'><code>ElementRef</code></a> of the found element or null. (Throws if not found.)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#getComponent getComponent
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getComponent(hostLocation: ElementRef)
|
||||
|
||||
:markdown
|
||||
Returns the component instance for a given element.
|
||||
|
||||
The component is the execution context as seen by an expression at that <a href='ElementRef-class.html'><code>ElementRef</code></a>
|
||||
location.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#createRootHostView createRootHostView
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
createRootHostView(hostProtoViewRef: ProtoViewRef, overrideSelector: string, injector: Injector)
|
||||
|
||||
:markdown
|
||||
Load component view into existing element.
|
||||
|
||||
Use this if a host element is already in the DOM and it is necessary to upgrade
|
||||
the element into Angular component by attaching a view but reusing the existing element.
|
||||
|
||||
- `hostProtoViewRef`: <a href='ProtoViewRef-interface.html'><code>ProtoViewRef</code></a> Proto view to use in creating a view for this
|
||||
component.
|
||||
- `overrideSelector`: (optional) selector to use in locating the existing element to load
|
||||
the view into. If not specified use the selector in the component definition of the
|
||||
`hostProtoView`.
|
||||
- injector: <a href='Injector-class.html'><code>Injector</code></a> to use as parent injector for the view.
|
||||
|
||||
See <a href='AppViewManager-interface.html#destroyRootHostView'><code>AppViewManager</code></a>.
|
||||
|
||||
|
||||
|
||||
```
|
||||
@ng.Component({
|
||||
selector: 'child-component'
|
||||
})
|
||||
@ng.View({
|
||||
template: 'Child'
|
||||
})
|
||||
class ChildComponent {
|
||||
|
||||
}
|
||||
|
||||
@ng.Component({
|
||||
selector: 'my-app'
|
||||
})
|
||||
@ng.View({
|
||||
template: `
|
||||
Parent (<some-component></some-component>)
|
||||
`
|
||||
})
|
||||
class MyApp {
|
||||
viewRef: ng.ViewRef;
|
||||
|
||||
constructor(public appViewManager: ng.AppViewManager, compiler: ng.Compiler) {
|
||||
compiler.compileInHost(ChildComponent).then((protoView: ng.ProtoViewRef) => {
|
||||
this.viewRef = appViewManager.createRootHostView(protoView, 'some-component', null);
|
||||
})
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
this.appViewManager.destroyRootHostView(this.viewRef);
|
||||
this.viewRef = null;
|
||||
}
|
||||
}
|
||||
|
||||
ng.bootstrap(MyApp);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#destroyRootHostView destroyRootHostView
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
destroyRootHostView(hostViewRef: HostViewRef)
|
||||
|
||||
:markdown
|
||||
Remove the View created with <a href='AppViewManager-interface.html#createRootHostView'><code>AppViewManager</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#createEmbeddedViewInContainer createEmbeddedViewInContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
createEmbeddedViewInContainer(viewContainerLocation: ElementRef, atIndex: number, templateRef: TemplateRef)
|
||||
|
||||
:markdown
|
||||
See <a href='AppViewManager-interface.html#destroyViewInContainer'><code>AppViewManager</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#createHostViewInContainer createHostViewInContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
createHostViewInContainer(viewContainerLocation: ElementRef, atIndex: number, protoViewRef: ProtoViewRef, imperativelyCreatedInjector: ResolvedBinding[])
|
||||
|
||||
:markdown
|
||||
See <a href='AppViewManager-interface.html#destroyViewInContainer'><code>AppViewManager</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#destroyViewInContainer destroyViewInContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
destroyViewInContainer(viewContainerLocation: ElementRef, atIndex: number)
|
||||
|
||||
:markdown
|
||||
See <a href='AppViewManager-interface.html#createViewInContainer'><code>AppViewManager</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#attachViewInContainer attachViewInContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
attachViewInContainer(viewContainerLocation: ElementRef, atIndex: number, viewRef: ViewRef)
|
||||
|
||||
:markdown
|
||||
See <a href='AppViewManager-interface.html#detachViewInContainer'><code>AppViewManager</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#detachViewInContainer detachViewInContainer
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
detachViewInContainer(viewContainerLocation: ElementRef, atIndex: number)
|
||||
|
||||
:markdown
|
||||
See <a href='AppViewManager-interface.html#attachViewInContainer'><code>AppViewManager</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/application_ref.ts#L242-L320">angular2/src/core/application_ref.ts (line 242)</a>
|
||||
|
||||
:markdown
|
||||
Represents an Angular application.
|
||||
|
||||
Use to retrieve the application <a href='Injector-class.html'><code>Injector</code></a> or to bootstrap new
|
||||
components at the root of the application. Can also be used to dispose
|
||||
of the entire application and all its loaded components.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#registerBootstrapListener registerBootstrapListener
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
registerBootstrapListener(listener: (ref: ComponentRef) => void)
|
||||
|
||||
:markdown
|
||||
Register a listener to be called each time a new root component type is bootstrapped.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#bootstrap bootstrap
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
bootstrap(componentType: Type, bindings?: Array<Type | Binding | any[]>)
|
||||
|
||||
:markdown
|
||||
Bootstrap a new component at the root level of the application, optionally with
|
||||
component specific bindings.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#injector injector
|
||||
|
||||
|
||||
:markdown
|
||||
Retrieve the application <a href='Injector-class.html'><code>Injector</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#zone zone
|
||||
|
||||
|
||||
:markdown
|
||||
Retrieve the application <a href='NgZone-interface.html'><code>NgZone</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#dispose dispose
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
dispose()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/async_pipe.ts#L35-L133">angular2/src/core/pipes/async_pipe.ts (line 35)</a>
|
||||
|
||||
:markdown
|
||||
The `async` pipe subscribes to an Observable or Promise and returns the latest value it has
|
||||
emitted.
|
||||
When a new value is emitted, the `async` pipe marks the component to be checked for changes.
|
||||
|
||||
# Example
|
||||
The example below binds the `time` Observable to the view. Every 500ms, the `time` Observable
|
||||
updates the view with the current time.
|
||||
|
||||
```
|
||||
import {Observable} from 'angular2/core';
|
||||
@Component({
|
||||
selector: "task-cmp"
|
||||
})
|
||||
@View({
|
||||
template: "Time: {{ time | async }}"
|
||||
})
|
||||
class Task {
|
||||
time = new Observable<number>(observer => {
|
||||
setInterval(_ =>
|
||||
observer.next(new Date().getTime()), 500);
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-sub-section
|
||||
h3.annotation Pipe
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Pipe({name: 'async', pure: false})
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3.annotation Injectable
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Injectable()
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(_ref: ChangeDetectorRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#onDestroy onDestroy
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
onDestroy()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#transform transform
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
transform(obj: Observable | Promise<any>, args?: any[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L507-L507">angular2/src/core/metadata.ts (line 507)</a>
|
||||
|
||||
:markdown
|
||||
<a href='AttributeMetadata-class.html'><code>AttributeMetadata</code></a> factory function.
|
||||
|
||||
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L282-L333">angular2/src/core/metadata.ts (line 282)</a>
|
||||
|
||||
:markdown
|
||||
<a href='AttributeMetadata-class.html'><code>AttributeMetadata</code></a> factory for creating annotations, decorators or DSL.
|
||||
|
||||
## Example as TypeScript Decorator
|
||||
|
||||
```
|
||||
import {Attribute, Component, View} from "angular2/angular2";
|
||||
|
||||
@Component({...})
|
||||
@View({...})
|
||||
class MyComponent {
|
||||
constructor(@Attribute('title') title: string) {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Example as ES5 DSL
|
||||
|
||||
```
|
||||
var MyComponent = ng
|
||||
.Component({...})
|
||||
.View({...})
|
||||
.Class({
|
||||
constructor: [new ng.Attribute('title'), function(title) {
|
||||
...
|
||||
}]
|
||||
})
|
||||
```
|
||||
|
||||
## Example as ES5 annotation
|
||||
|
||||
```
|
||||
var MyComponent = function(title) {
|
||||
...
|
||||
};
|
||||
|
||||
MyComponent.annotations = [
|
||||
new ng.Component({...}),
|
||||
new ng.View({...})
|
||||
]
|
||||
MyComponent.parameters = [
|
||||
[new ng.Attribute('title')]
|
||||
]
|
||||
```
|
||||
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata/di.ts#L9-L50">angular2/src/core/metadata/di.ts (line 9)</a>
|
||||
|
||||
:markdown
|
||||
Specifies that a constant attribute value should be injected.
|
||||
|
||||
The directive can inject constant string literals of host element attributes.
|
||||
|
||||
## Example
|
||||
|
||||
Suppose we have an `<input>` element and want to know its `type`.
|
||||
|
||||
```html
|
||||
<input type="text">
|
||||
```
|
||||
|
||||
A decorator can inject string literal `text` like so:
|
||||
|
||||
```javascript
|
||||
@Directive({
|
||||
selector: `input'
|
||||
})
|
||||
class InputDirective {
|
||||
constructor(@Attribute('type') type) {
|
||||
// type would be `text` in this example
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(attributeName: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#attributeName attributeName
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#token token
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#toString toString
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
toString()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,252 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/binding.ts#L41-L229">angular2/src/core/di/binding.ts (line 41)</a>
|
||||
|
||||
:markdown
|
||||
Describes how_ the <a href='Injector-class.html'><code>Injector</code></a> should instantiate a given token.
|
||||
|
||||
See <a href='bind-function.html'><code>bind</code></a>.
|
||||
|
||||
## Example
|
||||
|
||||
```javascript
|
||||
var injector = Injector.resolveAndCreate([
|
||||
new Binding(String, { toValue: 'Hello' })
|
||||
]);
|
||||
|
||||
expect(injector.get(String)).toEqual('Hello');
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(token: any, {toClass, toValue, toAlias, toFactory, deps, multi}: {
|
||||
toClass?: Type,
|
||||
toValue?: any,
|
||||
toAlias?: any,
|
||||
toFactory?: Function,
|
||||
deps?: Object[],
|
||||
multi?: boolean
|
||||
})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#token token
|
||||
|
||||
|
||||
:markdown
|
||||
Token used when retrieving this binding. Usually the `Type`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#toClass toClass
|
||||
|
||||
|
||||
:markdown
|
||||
Binds an interface to an implementation / subclass.
|
||||
|
||||
|
||||
|
||||
Because `toAlias` and `toClass` are often confused, the example contains both use cases for
|
||||
easy
|
||||
comparison.
|
||||
|
||||
```javascript
|
||||
|
||||
class Vehicle {}
|
||||
|
||||
class Car extends Vehicle {}
|
||||
|
||||
var injectorClass = Injector.resolveAndCreate([
|
||||
Car,
|
||||
new Binding(Vehicle, { toClass: Car })
|
||||
]);
|
||||
var injectorAlias = Injector.resolveAndCreate([
|
||||
Car,
|
||||
new Binding(Vehicle, { toAlias: Car })
|
||||
]);
|
||||
|
||||
expect(injectorClass.get(Vehicle)).not.toBe(injectorClass.get(Car));
|
||||
expect(injectorClass.get(Vehicle) instanceof Car).toBe(true);
|
||||
|
||||
expect(injectorAlias.get(Vehicle)).toBe(injectorAlias.get(Car));
|
||||
expect(injectorAlias.get(Vehicle) instanceof Car).toBe(true);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#toValue toValue
|
||||
|
||||
|
||||
:markdown
|
||||
Binds a key to a value.
|
||||
|
||||
|
||||
|
||||
```javascript
|
||||
var injector = Injector.resolveAndCreate([
|
||||
new Binding(String, { toValue: 'Hello' })
|
||||
]);
|
||||
|
||||
expect(injector.get(String)).toEqual('Hello');
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#toAlias toAlias
|
||||
|
||||
|
||||
:markdown
|
||||
Binds a key to the alias for an existing key.
|
||||
|
||||
An alias means that <a href='Injector-class.html'><code>Injector</code></a> returns the same instance as if the alias token was used.
|
||||
This is in contrast to `toClass` where a separate instance of `toClass` is returned.
|
||||
|
||||
|
||||
|
||||
Because `toAlias` and `toClass` are often confused the example contains both use cases for easy
|
||||
comparison.
|
||||
|
||||
```javascript
|
||||
|
||||
class Vehicle {}
|
||||
|
||||
class Car extends Vehicle {}
|
||||
|
||||
var injectorAlias = Injector.resolveAndCreate([
|
||||
Car,
|
||||
new Binding(Vehicle, { toAlias: Car })
|
||||
]);
|
||||
var injectorClass = Injector.resolveAndCreate([
|
||||
Car,
|
||||
new Binding(Vehicle, { toClass: Car })
|
||||
]);
|
||||
|
||||
expect(injectorAlias.get(Vehicle)).toBe(injectorAlias.get(Car));
|
||||
expect(injectorAlias.get(Vehicle) instanceof Car).toBe(true);
|
||||
|
||||
expect(injectorClass.get(Vehicle)).not.toBe(injectorClass.get(Car));
|
||||
expect(injectorClass.get(Vehicle) instanceof Car).toBe(true);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#toFactory toFactory
|
||||
|
||||
|
||||
:markdown
|
||||
Binds a key to a function which computes the value.
|
||||
|
||||
|
||||
|
||||
```javascript
|
||||
var injector = Injector.resolveAndCreate([
|
||||
new Binding(Number, { toFactory: () => { return 1+2; }}),
|
||||
new Binding(String, { toFactory: (value) => { return "Value: " + value; },
|
||||
dependencies: [Number] })
|
||||
]);
|
||||
|
||||
expect(injector.get(Number)).toEqual(3);
|
||||
expect(injector.get(String)).toEqual('Value: 3');
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#dependencies dependencies
|
||||
|
||||
|
||||
:markdown
|
||||
Used in conjunction with `toFactory` and specifies a set of dependencies
|
||||
(as `token`s) which should be injected into the factory function.
|
||||
|
||||
|
||||
|
||||
```javascript
|
||||
var injector = Injector.resolveAndCreate([
|
||||
new Binding(Number, { toFactory: () => { return 1+2; }}),
|
||||
new Binding(String, { toFactory: (value) => { return "Value: " + value; },
|
||||
dependencies: [Number] })
|
||||
]);
|
||||
|
||||
expect(injector.get(Number)).toEqual(3);
|
||||
expect(injector.get(String)).toEqual('Value: 3');
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#multi multi
|
||||
|
||||
|
||||
:markdown
|
||||
Used to create multiple bindings matching the same token.
|
||||
|
||||
|
||||
|
||||
```javascript
|
||||
var injector = Injector.resolveAndCreate([
|
||||
new Binding("Strings", { toValue: "String1", multi: true}),
|
||||
new Binding("Strings", { toValue: "String2", multi: true})
|
||||
]);
|
||||
|
||||
expect(injector.get("Strings")).toEqual(["String1", "String2"]);
|
||||
```
|
||||
|
||||
Multi bindings and regular bindings cannot be mixed. The following
|
||||
will throw an exception:
|
||||
|
||||
```javascript
|
||||
var injector = Injector.resolveAndCreate([
|
||||
new Binding("Strings", { toValue: "String1", multi: true}),
|
||||
new Binding("Strings", { toValue: "String2"})
|
||||
]);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/binding.ts#L305-L419">angular2/src/core/di/binding.ts (line 305)</a>
|
||||
|
||||
:markdown
|
||||
Helper class for the <a href='bind-function.html'><code>bind</code></a> function.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(token: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#token token
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#toClass toClass
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
toClass(type: Type)
|
||||
|
||||
:markdown
|
||||
Binds an interface to an implementation / subclass.
|
||||
|
||||
|
||||
|
||||
Because `toAlias` and `toClass` are often confused, the example contains both use cases for
|
||||
easy comparison.
|
||||
|
||||
```javascript
|
||||
|
||||
class Vehicle {}
|
||||
|
||||
class Car extends Vehicle {}
|
||||
|
||||
var injectorClass = Injector.resolveAndCreate([
|
||||
Car,
|
||||
bind(Vehicle).toClass(Car)
|
||||
]);
|
||||
var injectorAlias = Injector.resolveAndCreate([
|
||||
Car,
|
||||
bind(Vehicle).toAlias(Car)
|
||||
]);
|
||||
|
||||
expect(injectorClass.get(Vehicle)).not.toBe(injectorClass.get(Car));
|
||||
expect(injectorClass.get(Vehicle) instanceof Car).toBe(true);
|
||||
|
||||
expect(injectorAlias.get(Vehicle)).toBe(injectorAlias.get(Car));
|
||||
expect(injectorAlias.get(Vehicle) instanceof Car).toBe(true);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#toValue toValue
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
toValue(value: any)
|
||||
|
||||
:markdown
|
||||
Binds a key to a value.
|
||||
|
||||
|
||||
|
||||
```javascript
|
||||
var injector = Injector.resolveAndCreate([
|
||||
bind(String).toValue('Hello')
|
||||
]);
|
||||
|
||||
expect(injector.get(String)).toEqual('Hello');
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#toAlias toAlias
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
toAlias(aliasToken: /*Type*/ any)
|
||||
|
||||
:markdown
|
||||
Binds a key to the alias for an existing key.
|
||||
|
||||
An alias means that we will return the same instance as if the alias token was used. (This is
|
||||
in contrast to `toClass` where a separate instance of `toClass` will be returned.)
|
||||
|
||||
|
||||
|
||||
Because `toAlias` and `toClass` are often confused, the example contains both use cases for
|
||||
easy
|
||||
comparison.
|
||||
|
||||
```javascript
|
||||
|
||||
class Vehicle {}
|
||||
|
||||
class Car extends Vehicle {}
|
||||
|
||||
var injectorAlias = Injector.resolveAndCreate([
|
||||
Car,
|
||||
bind(Vehicle).toAlias(Car)
|
||||
]);
|
||||
var injectorClass = Injector.resolveAndCreate([
|
||||
Car,
|
||||
bind(Vehicle).toClass(Car)
|
||||
]);
|
||||
|
||||
expect(injectorAlias.get(Vehicle)).toBe(injectorAlias.get(Car));
|
||||
expect(injectorAlias.get(Vehicle) instanceof Car).toBe(true);
|
||||
|
||||
expect(injectorClass.get(Vehicle)).not.toBe(injectorClass.get(Car));
|
||||
expect(injectorClass.get(Vehicle) instanceof Car).toBe(true);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#toFactory toFactory
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
toFactory(factoryFunction: Function, dependencies?: any[])
|
||||
|
||||
:markdown
|
||||
Binds a key to a function which computes the value.
|
||||
|
||||
|
||||
|
||||
```javascript
|
||||
var injector = Injector.resolveAndCreate([
|
||||
bind(Number).toFactory(() => { return 1+2; }),
|
||||
bind(String).toFactory((v) => { return "Value: " + v; }, [Number])
|
||||
]);
|
||||
|
||||
expect(injector.get(Number)).toEqual(3);
|
||||
expect(injector.get(String)).toEqual('Value: 3');
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/injector.ts#L381-L387">angular2/src/core/di/injector.ts (line 381)</a>
|
||||
|
||||
:markdown
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(binding: ResolvedBinding, visibility: Visibility)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#binding binding
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#visibility visibility
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#getKeyId getKeyId
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getKeyId()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/debug/debug_element.ts#L184-L199">angular2/src/core/debug/debug_element.ts (line 184)</a>
|
||||
|
||||
:markdown
|
|
@ -1,49 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/directives.ts#L64-L65">angular2/src/core/directives.ts (line 64)</a>
|
||||
|
||||
:markdown
|
||||
A collection of the Angular core directives that are likely to be used in each and every Angular
|
||||
application.
|
||||
|
||||
This collection can be used to quickly enumerate all the built-in directives in the `@View`
|
||||
annotation. For example,
|
||||
instead of writing:
|
||||
|
||||
```
|
||||
import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/angular2';
|
||||
import {OtherDirective} from 'myDirectives';
|
||||
|
||||
@Component({
|
||||
selector: 'my-component'
|
||||
})
|
||||
@View({
|
||||
templateUrl: 'myComponent.html',
|
||||
directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
|
||||
})
|
||||
export class MyComponent {
|
||||
...
|
||||
}
|
||||
```
|
||||
one could import all the core directives at once:
|
||||
|
||||
```
|
||||
import {CORE_DIRECTIVES} from 'angular2/angular2';
|
||||
import {OtherDirective} from 'myDirectives';
|
||||
|
||||
@Component({
|
||||
selector: 'my-component'
|
||||
})
|
||||
@View({
|
||||
templateUrl: 'myComponent.html',
|
||||
directives: [CORE_DIRECTIVES, OtherDirective]
|
||||
})
|
||||
export class MyComponent {
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/exceptions.ts#L17-L34">angular2/src/core/change_detection/exceptions.ts (line 17)</a>
|
||||
|
||||
:markdown
|
||||
Thrown when an expression evaluation raises an exception.
|
||||
|
||||
This error wraps the original exception, this is done to attach expression location information.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(exp: string, originalException: any, originalStack: any, context: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#location location
|
||||
|
||||
|
||||
:markdown
|
||||
Location of the expression.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/constants.ts#L8-L49">angular2/src/core/change_detection/constants.ts (line 8)</a>
|
||||
|
||||
:markdown
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#CheckOnce CheckOnce
|
||||
|
||||
|
||||
:markdown
|
||||
`CheckedOnce` means that after calling detectChanges the mode of the change detector
|
||||
will become `Checked`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#Checked Checked
|
||||
|
||||
|
||||
:markdown
|
||||
`Checked` means that the change detector should be skipped until its mode changes to
|
||||
`CheckOnce`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#CheckAlways CheckAlways
|
||||
|
||||
|
||||
:markdown
|
||||
`CheckAlways` means that after calling detectChanges the mode of the change detector
|
||||
will remain `CheckAlways`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#Detached Detached
|
||||
|
||||
|
||||
:markdown
|
||||
`Detached` means that the change detector sub tree is not a part of the main tree and
|
||||
should be skipped.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#OnPush OnPush
|
||||
|
||||
|
||||
:markdown
|
||||
`OnPush` means that the change detector's mode will be set to `CheckOnce` during hydration.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#Default Default
|
||||
|
||||
|
||||
:markdown
|
||||
`Default` means that the change detector's mode will be set to `CheckAlways` during hydration.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#OnPushObserve OnPushObserve
|
||||
|
||||
|
||||
:markdown
|
||||
This is an experimental feature. Works only in Dart.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/interfaces.ts#L55-L74">angular2/src/core/change_detection/interfaces.ts (line 55)</a>
|
||||
|
||||
:markdown
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#parent parent
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#mode mode
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#ref ref
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#addChild addChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
addChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#addShadowDomChild addShadowDomChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
addShadowDomChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#removeChild removeChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
removeChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#removeShadowDomChild removeShadowDomChild
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
removeShadowDomChild(cd: ChangeDetector)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#remove remove
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
remove()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#hydrate hydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
hydrate(context: any, locals: Locals, directives: any, pipes: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#dehydrate dehydrate
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
dehydrate()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#markPathToRootAsCheckOnce markPathToRootAsCheckOnce
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
markPathToRootAsCheckOnce()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#handleEvent handleEvent
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
handleEvent(eventName: string, elIndex: number, locals: Locals)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#detectChanges detectChanges
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
detectChanges()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#checkNoChanges checkNoChanges
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
checkNoChanges()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/change_detection/change_detector_ref.ts#L2-L40">angular2/src/core/change_detection/change_detector_ref.ts (line 2)</a>
|
||||
|
||||
:markdown
|
||||
Controls change detection.
|
||||
|
||||
<a href='ChangeDetectorRef-interface.html'><code>ChangeDetectorRef</code></a> allows requesting checks for detectors that rely on observables. It
|
||||
also allows detaching and attaching change detector subtrees.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#markForCheck markForCheck
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
markForCheck()
|
||||
|
||||
:markdown
|
||||
Request to check all OnPush ancestors.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#detach detach
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
detach()
|
||||
|
||||
:markdown
|
||||
Detaches the change detector from the change detector tree.
|
||||
|
||||
The detached change detector will not be checked until it is reattached.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#detectChanges detectChanges
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
detectChanges()
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#reattach reattach
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
reattach()
|
||||
|
||||
:markdown
|
||||
Reattach the change detector to the change detector tree.
|
||||
|
||||
This also requests a check of this change detector. This reattached change detector will be
|
||||
checked during the next change detection run.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,173 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/checkbox_value_accessor.ts#L9-L66">angular2/src/core/forms/directives/checkbox_value_accessor.ts (line 9)</a>
|
||||
|
||||
:markdown
|
||||
The accessor for writing a value and listening to changes on a checkbox input element.
|
||||
|
||||
# Example
|
||||
```
|
||||
<input type="checkbox" [ng-control]="rememberLogin">
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-sub-section
|
||||
h3.annotation Directive
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Directive({
|
||||
selector:
|
||||
'input[type=checkbox][ng-control],input[type=checkbox][ng-form-control],input[type=checkbox][ng-model]',
|
||||
host: {
|
||||
'(change)': 'onChange($event.target.checked)',
|
||||
'(blur)': 'onTouched()',
|
||||
'[class.ng-untouched]': 'ngClassUntouched',
|
||||
'[class.ng-touched]': 'ngClassTouched',
|
||||
'[class.ng-pristine]': 'ngClassPristine',
|
||||
'[class.ng-dirty]': 'ngClassDirty',
|
||||
'[class.ng-valid]': 'ngClassValid',
|
||||
'[class.ng-invalid]': 'ngClassInvalid'
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(cd: NgControl, _renderer: Renderer, _elementRef: ElementRef)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#onChange onChange
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#onTouched onTouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#writeValue writeValue
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
writeValue(value: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#ngClassUntouched ngClassUntouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#ngClassTouched ngClassTouched
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#ngClassPristine ngClassPristine
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#ngClassDirty ngClassDirty
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#ngClassValid ngClassValid
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#ngClassInvalid ngClassInvalid
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#registerOnChange registerOnChange
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
registerOnChange(fn: (_: any) => {})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#registerOnTouched registerOnTouched
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
registerOnTouched(fn: () => {})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
h2(class="function export") Class
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
Class(clsDef: ClassDefinition) : Type
|
||||
|
||||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/util/decorators.ts#L119-L226">angular2/src/core/util/decorators.ts (line 119)</a>
|
||||
|
||||
:markdown
|
||||
Provides a way for expressing ES6 classes with parameter annotations in ES5.
|
||||
|
||||
## Basic Example
|
||||
|
||||
```
|
||||
var Greeter = ng.Class({
|
||||
constructor: function(name) {
|
||||
this.name = name;
|
||||
},
|
||||
|
||||
greet: function() {
|
||||
alert('Hello ' + this.name + '!');
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
is equivalent to ES6:
|
||||
|
||||
```
|
||||
class Greeter {
|
||||
constructor(name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
greet() {
|
||||
alert('Hello ' + this.name + '!');
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
or equivalent to ES5:
|
||||
|
||||
```
|
||||
var Greeter = function (name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
Greeter.prototype.greet = function () {
|
||||
alert('Hello ' + this.name + '!');
|
||||
}
|
||||
```
|
||||
|
||||
## Example with parameter annotations
|
||||
|
||||
```
|
||||
var MyService = ng.Class({
|
||||
constructor: [String, [new Query(), QueryList], function(name, queryList) {
|
||||
...
|
||||
}]
|
||||
});
|
||||
```
|
||||
|
||||
is equivalent to ES6:
|
||||
|
||||
```
|
||||
class MyService {
|
||||
constructor(name: string, @Query() queryList: QueryList) {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Example with inheritance
|
||||
|
||||
```
|
||||
var Shape = ng.Class({
|
||||
constructor: (color) {
|
||||
this.color = color;
|
||||
}
|
||||
});
|
||||
|
||||
var Square = ng.Class({
|
||||
extends: Shape,
|
||||
constructor: function(color, size) {
|
||||
Shape.call(this, color);
|
||||
this.size = size;
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/util/decorators.ts#L1-L22">angular2/src/core/util/decorators.ts (line 1)</a>
|
||||
|
||||
:markdown
|
||||
Declares the interface to be used with <a href='Class-function.html'><code>Class</code></a>.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#extends extends?
|
||||
|
||||
|
||||
:markdown
|
||||
Optional argument for specifying the superclass.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
:markdown
|
||||
Required constructor function for a class.
|
||||
|
||||
The function may be optionally wrapped in an `Array`, in which case additional parameter
|
||||
annotations may be specified.
|
||||
The number of arguments and the number of parameter annotations must match.
|
||||
|
||||
See <a href='Class-function.html'><code>Class</code></a> for example of usage.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/compiler.ts#L71-L361">angular2/src/core/compiler/compiler.ts (line 71)</a>
|
||||
|
||||
:markdown
|
||||
## URL Resolution
|
||||
|
||||
```
|
||||
var appRootUrl: AppRootUrl = ...;
|
||||
var componentUrlMapper: ComponentUrlMapper = ...;
|
||||
var urlResolver: UrlResolver = ...;
|
||||
|
||||
var componentType: Type = ...;
|
||||
var componentAnnotation: ComponentAnnotation = ...;
|
||||
var viewAnnotation: ViewAnnotation = ...;
|
||||
|
||||
// Resolving a URL
|
||||
|
||||
var url = viewAnnotation.templateUrl;
|
||||
var componentUrl = componentUrlMapper.getUrl(componentType);
|
||||
var componentResolvedUrl = urlResolver.resolve(appRootUrl.value, componentUrl);
|
||||
var templateResolvedUrl = urlResolver.resolve(componetResolvedUrl, url);
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-sub-section
|
||||
h3.annotation Injectable
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Injectable()
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#compileInHost compileInHost
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
compileInHost(componentTypeOrBinding: Type | Binding)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L491-L492">angular2/src/core/metadata.ts (line 491)</a>
|
||||
|
||||
:markdown
|
||||
<a href='ComponentMetadata-class.html'><code>ComponentMetadata</code></a> factory function.
|
||||
|
||||
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L57-L77">angular2/src/core/metadata.ts (line 57)</a>
|
||||
|
||||
:markdown
|
||||
Interface for the <a href='ComponentMetadata-class.html'><code>ComponentMetadata</code></a> decorator function.
|
||||
|
||||
See <a href='ComponentFactory-interface.html'><code>ComponentFactory</code></a>.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#View View
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
View(obj: {
|
||||
templateUrl?: string,
|
||||
template?: string,
|
||||
directives?: Array<Type | any | any[]>,
|
||||
pipes?: Array<Type | any | any[]>,
|
||||
renderer?: string,
|
||||
styles?: string[],
|
||||
styleUrls?: string[],
|
||||
})
|
||||
|
||||
:markdown
|
||||
Chain <a href='ViewMetadata-class.html'><code>ViewMetadata</code></a> annotation.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata.ts#L148-L220">angular2/src/core/metadata.ts (line 148)</a>
|
||||
|
||||
:markdown
|
||||
<a href='ComponentMetadata-class.html'><code>ComponentMetadata</code></a> factory for creating annotations, decorators or DSL.
|
||||
|
||||
## Example as TypeScript Decorator
|
||||
|
||||
```
|
||||
import {Component, View} from "angular2/angular2";
|
||||
|
||||
@Component({...})
|
||||
@View({...})
|
||||
class MyComponent {
|
||||
constructor() {
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Example as ES5 DSL
|
||||
|
||||
```
|
||||
var MyComponent = ng
|
||||
.Component({...})
|
||||
.View({...})
|
||||
.Class({
|
||||
constructor: function() {
|
||||
...
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Example as ES5 annotation
|
||||
|
||||
```
|
||||
var MyComponent = function() {
|
||||
...
|
||||
};
|
||||
|
||||
MyComponent.annotations = [
|
||||
new ng.Component({...}),
|
||||
new ng.View({...})
|
||||
]
|
||||
```
|
||||
|
||||
|
|
@ -1,190 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/metadata/directives.ts#L745-L903">angular2/src/core/metadata/directives.ts (line 745)</a>
|
||||
|
||||
:markdown
|
||||
Declare reusable UI building blocks for an application.
|
||||
|
||||
Each Angular component requires a single `@Component` and at least one `@View` annotation. The
|
||||
`@Component`
|
||||
annotation specifies when a component is instantiated, and which properties and hostListeners it
|
||||
binds to.
|
||||
|
||||
When a component is instantiated, Angular
|
||||
- creates a shadow DOM for the component.
|
||||
- loads the selected template into the shadow DOM.
|
||||
- creates all the injectable objects configured with `bindings` and `viewBindings`.
|
||||
|
||||
All template expressions and statements are then evaluated against the component instance.
|
||||
|
||||
For details on the `@View` annotation, see <a href='ViewMetadata-class.html'><code>ViewMetadata</code></a>.
|
||||
|
||||
## Lifecycle hooks
|
||||
|
||||
When the component class implements some <a href='../lifecycle_hooks'><code>undefined</code></a> the callbacks are
|
||||
called by the change detection at defined points in time during the life of the component.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
@Component({
|
||||
selector: 'greet'
|
||||
})
|
||||
@View({
|
||||
template: 'Hello {{name}}!'
|
||||
})
|
||||
class Greet {
|
||||
name: string;
|
||||
|
||||
constructor() {
|
||||
this.name = 'World';
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor({selector, properties, events, host, dynamicLoadable, compiledHostTemplate, exportAs,
|
||||
moduleId, bindings, viewBindings, changeDetection = ChangeDetectionStrategy.Default,
|
||||
compileChildren = true}?: {
|
||||
selector?: string,
|
||||
properties?: string[],
|
||||
events?: string[],
|
||||
host?: StringMap<string, string>,
|
||||
dynamicLoadable?: boolean,
|
||||
compiledHostTemplate?: any,
|
||||
bindings?: any[],
|
||||
exportAs?: string,
|
||||
moduleId?: string,
|
||||
compileChildren?: boolean,
|
||||
viewBindings?: any[],
|
||||
changeDetection?: ChangeDetectionStrategy,
|
||||
})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#dynamicLoadable dynamicLoadable
|
||||
|
||||
|
||||
:markdown
|
||||
Declare that this component can be programatically loaded.
|
||||
Every component that is used in bootstrap, routing, ... has to be
|
||||
annotated with this.
|
||||
|
||||
|
||||
|
||||
```
|
||||
@Component({
|
||||
selector: 'root',
|
||||
dynamicLoadable: true
|
||||
})
|
||||
@View({
|
||||
template: 'hello world!'
|
||||
})
|
||||
class RootComponent {
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#compiledHostTemplate compiledHostTemplate
|
||||
|
||||
|
||||
:markdown
|
||||
Used by build tools to store the compiled template.
|
||||
Not intended to be used by a user.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#changeDetection changeDetection
|
||||
|
||||
|
||||
:markdown
|
||||
Defines the used change detection strategy.
|
||||
|
||||
When a component is instantiated, Angular creates a change detector, which is responsible for
|
||||
propagating the component's bindings.
|
||||
|
||||
The `changeDetection` property defines, whether the change detection will be checked every time
|
||||
or only when the component tells it to do so.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#viewBindings viewBindings
|
||||
|
||||
|
||||
:markdown
|
||||
Defines the set of injectable objects that are visible to its view DOM children.
|
||||
|
||||
## Simple Example
|
||||
|
||||
Here is an example of a class that can be injected:
|
||||
|
||||
```
|
||||
class Greeter {
|
||||
greet(name:string) {
|
||||
return 'Hello ' + name + '!';
|
||||
}
|
||||
}
|
||||
|
||||
@Directive({
|
||||
selector: 'needs-greeter'
|
||||
})
|
||||
class NeedsGreeter {
|
||||
greeter:Greeter;
|
||||
|
||||
constructor(greeter:Greeter) {
|
||||
this.greeter = greeter;
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'greet',
|
||||
viewBindings: [
|
||||
Greeter
|
||||
]
|
||||
})
|
||||
@View({
|
||||
template: `<needs-greeter></needs-greeter>`,
|
||||
directives: [NeedsGreeter]
|
||||
})
|
||||
class HelloWorld {
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/dynamic_component_loader.ts#L11-L58">angular2/src/core/compiler/dynamic_component_loader.ts (line 11)</a>
|
||||
|
||||
:markdown
|
||||
Angular's reference to a component instance.
|
||||
|
||||
`ComponentRef` represents a component instance lifecycle and meta information.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#location location
|
||||
|
||||
|
||||
:markdown
|
||||
Location of the component host element.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#instance instance
|
||||
|
||||
|
||||
:markdown
|
||||
Instance of component.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#componentType componentType
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#injector injector
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#hostView hostView
|
||||
|
||||
|
||||
:markdown
|
||||
Returns the host <a href='ViewRef-interface.html'><code>ViewRef</code></a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#hostComponentType hostComponentType
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#hostComponent hostComponent
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#dispose dispose
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
dispose()
|
||||
|
||||
:markdown
|
||||
Dispose of the component instance.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/compiler/component_url_mapper.ts#L4-L24">angular2/src/core/compiler/component_url_mapper.ts (line 4)</a>
|
||||
|
||||
:markdown
|
||||
Resolve a `Type` from a <a href='ComponentMetadata-class.html'><code>ComponentMetadata</code></a> into a URL.
|
||||
|
||||
This interface can be overridden by the application developer to create custom behavior.
|
||||
|
||||
See <a href='Compiler-interface.html'><code>Compiler</code></a>
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-sub-section
|
||||
h3.annotation Injectable
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Injectable()
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#getUrl getUrl
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getUrl(component: Type)
|
||||
|
||||
:markdown
|
||||
Returns the base URL to the component source file.
|
||||
The returned URL could be:
|
||||
- an absolute URL,
|
||||
- a path relative to the application
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/model.ts#L132-L161">angular2/src/core/forms/model.ts (line 132)</a>
|
||||
|
||||
:markdown
|
||||
Defines a part of a form that cannot be divided into other controls.
|
||||
|
||||
`Control` is one of the three fundamental building blocks used to define forms in Angular, along
|
||||
with <a href='ControlGroup-class.html'><code>ControlGroup</code></a> and <a href='ControlArray-class.html'><code>ControlArray</code></a>.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(value?: any, validator?: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#updateValue updateValue
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
updateValue(value: any, {onlySelf, emitEvent, emitModelToViewChange}?:
|
||||
{onlySelf?: boolean, emitEvent?: boolean, emitModelToViewChange?: boolean})
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#registerOnChange registerOnChange
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
registerOnChange(fn: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/model.ts#L238-L288">angular2/src/core/forms/model.ts (line 238)</a>
|
||||
|
||||
:markdown
|
||||
Defines a part of a form, of variable length, that can contain other controls.
|
||||
|
||||
A `ControlArray` aggregates the values and errors of each <a href='Control-class.html'><code>Control</code></a> in the group. Thus, if
|
||||
one of the controls in a group is invalid, the entire group is invalid. Similarly, if a control
|
||||
changes its value, the entire group changes as well.
|
||||
|
||||
`ControlArray` is one of the three fundamental building blocks used to define forms in Angular,
|
||||
along with <a href='Control-class.html'><code>Control</code></a> and <a href='ControlGroup-class.html'><code>ControlGroup</code></a>. <a href='ControlGroup-class.html'><code>ControlGroup</code></a> can also contain
|
||||
other controls, but is of fixed length.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(controls: AbstractControl[], validator?: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#controls controls
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#at at
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
at(index: number)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#push push
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
push(control: AbstractControl)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#insert insert
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
insert(index: number, control: AbstractControl)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#removeAt removeAt
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
removeAt(index: number)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#length length
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/control_container.ts#L2-L13">angular2/src/core/forms/directives/control_container.ts (line 2)</a>
|
||||
|
||||
:markdown
|
||||
A directive that contains multiple <a href='NgControl-class.html'><code>NgControl</code></a>.
|
||||
|
||||
Only used by the forms module.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#name name
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#formDirective formDirective
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#path path
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/model.ts#L161-L238">angular2/src/core/forms/model.ts (line 161)</a>
|
||||
|
||||
:markdown
|
||||
Defines a part of a form, of fixed length, that can contain other controls.
|
||||
|
||||
A `ControlGroup` aggregates the values and errors of each <a href='Control-class.html'><code>Control</code></a> in the group. Thus, if
|
||||
one of the controls in a group is invalid, the entire group is invalid. Similarly, if a control
|
||||
changes its value, the entire group changes as well.
|
||||
|
||||
`ControlGroup` is one of the three fundamental building blocks used to define forms in Angular,
|
||||
along with <a href='Control-class.html'><code>Control</code></a> and <a href='ControlArray-class.html'><code>ControlArray</code></a>. <a href='ControlArray-class.html'><code>ControlArray</code></a> can also contain other
|
||||
controls, but is of variable length.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(controls: StringMap<string, AbstractControl>, optionals?: StringMap<string, boolean>, validator?: Function)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#controls controls
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#addControl addControl
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
addControl(name: string, control: AbstractControl)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#removeControl removeControl
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
removeControl(name: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#include include
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
include(controlName: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#exclude exclude
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
exclude(controlName: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#contains contains
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
contains(controlName: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/forms/directives/control_value_accessor.ts#L1-L10">angular2/src/core/forms/directives/control_value_accessor.ts (line 1)</a>
|
||||
|
||||
:markdown
|
||||
A bridge between a control and a native element.
|
||||
|
||||
Please see <a href='DefaultValueAccessor-class.html'><code>DefaultValueAccessor</code></a> for more information.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#writeValue writeValue
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
writeValue(obj: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#registerOnChange registerOnChange
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
registerOnChange(fn: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#registerOnTouched registerOnTouched
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
registerOnTouched(fn: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/number_pipe.ts#L116-L145">angular2/src/core/pipes/number_pipe.ts (line 116)</a>
|
||||
|
||||
:markdown
|
||||
WARNING: this pipe uses the Internationalization API.
|
||||
Therefore it is only reliable in Chrome and Opera browsers.
|
||||
|
||||
Formats a number as local currency.
|
||||
|
||||
# Usage
|
||||
|
||||
expression | currency[:currencyCode[:symbolDisplay[:digitInfo]]]
|
||||
|
||||
where `currencyCode` is the ISO 4217 currency code, such as "USD" for the US dollar and
|
||||
"EUR" for the euro. `symbolDisplay` is a boolean indicating whether to use the currency
|
||||
symbol (e.g. $) or the currency code (e.g. USD) in the output. The default for this value
|
||||
is `false`.
|
||||
For more information about `digitInfo` see <a href='DecimalPipe-class.html'><code>DecimalPipe</code></a>
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-sub-section
|
||||
h3.annotation Pipe
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Pipe({name: 'currency'})
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3.annotation Injectable
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Injectable()
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#transform transform
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
transform(value: any, args: any[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/di/exceptions.ts#L68-L92">angular2/src/core/di/exceptions.ts (line 68)</a>
|
||||
|
||||
:markdown
|
||||
Thrown when dependencies form a cycle.
|
||||
|
||||
## Example:
|
||||
|
||||
```javascript
|
||||
class A {
|
||||
constructor(b:B) {}
|
||||
}
|
||||
class B {
|
||||
constructor(a:A) {}
|
||||
}
|
||||
```
|
||||
|
||||
Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#constructor constructor
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
constructor(injector: Injector, key: Key)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/default_pipes.ts#L26-L27">angular2/src/core/pipes/default_pipes.ts (line 26)</a>
|
||||
|
||||
:markdown
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/default_pipes.ts#L24-L24">angular2/src/core/pipes/default_pipes.ts (line 24)</a>
|
||||
|
||||
:markdown
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
.l-main-section
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/render/dom/dom_tokens.ts#L4-L4">angular2/src/core/render/dom/dom_tokens.ts (line 4)</a>
|
||||
|
||||
:markdown
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/date_pipe.ts#L21-L114">angular2/src/core/pipes/date_pipe.ts (line 21)</a>
|
||||
|
||||
:markdown
|
||||
WARNING: this pipe uses the Internationalization API.
|
||||
Therefore it is only reliable in Chrome and Opera browsers.
|
||||
|
||||
Formats a date value to a string based on the requested format.
|
||||
|
||||
# Usage
|
||||
|
||||
expression | date[:format]
|
||||
|
||||
where `expression` is a date object or a number (milliseconds since UTC epoch) and
|
||||
`format` indicates which date/time components to include:
|
||||
|
||||
| Component | Symbol | Short Form | Long Form | Numeric | 2-digit |
|
||||
|-----------|:------:|--------------|-------------------|-----------|-----------|
|
||||
| era | G | G (AD) | GGGG (Anno Domini)| - | - |
|
||||
| year | y | - | - | y (2015) | yy (15) |
|
||||
| month | M | MMM (Sep) | MMMM (September) | M (9) | MM (09) |
|
||||
| day | d | - | - | d (3) | dd (03) |
|
||||
| weekday | E | EEE (Sun) | EEEE (Sunday) | - | - |
|
||||
| hour | j | - | - | j (13) | jj (13) |
|
||||
| hour12 | h | - | - | h (1 PM) | hh (01 PM)|
|
||||
| hour24 | H | - | - | H (13) | HH (13) |
|
||||
| minute | m | - | - | m (5) | mm (05) |
|
||||
| second | s | - | - | s (9) | ss (09) |
|
||||
| timezone | z | - | z (Pacific Standard Time)| - | - |
|
||||
| timezone | Z | Z (GMT-8:00) | - | - | - |
|
||||
|
||||
In javascript, only the components specified will be respected (not the ordering,
|
||||
punctuations, ...) and details of the the formatting will be dependent on the locale.
|
||||
On the other hand in Dart version, you can also include quoted text as well as some extra
|
||||
date/time components such as quarter. For more information see:
|
||||
https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/intl/intl.DateFormat.
|
||||
|
||||
`format` can also be one of the following predefined formats:
|
||||
|
||||
- `'medium'`: equivalent to `'yMMMdjms'` (e.g. Sep 3, 2010, 12:05:08 PM for en-US)
|
||||
- `'short'`: equivalent to `'yMdjm'` (e.g. 9/3/2010, 12:05 PM for en-US)
|
||||
- `'fullDate'`: equivalent to `'yMMMMEEEEd'` (e.g. Friday, September 3, 2010 for en-US)
|
||||
- `'longDate'`: equivalent to `'yMMMMd'` (e.g. September 3, 2010)
|
||||
- `'mediumDate'`: equivalent to `'yMMMd'` (e.g. Sep 3, 2010 for en-US)
|
||||
- `'shortDate'`: equivalent to `'yMd'` (e.g. 9/3/2010 for en-US)
|
||||
- `'mediumTime'`: equivalent to `'jms'` (e.g. 12:05:08 PM for en-US)
|
||||
- `'shortTime'`: equivalent to `'jm'` (e.g. 12:05 PM for en-US)
|
||||
|
||||
Timezone of the formatted text will be the local system timezone of the end-users machine.
|
||||
|
||||
# Examples
|
||||
|
||||
Assuming `dateObj` is (year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11)
|
||||
in the _local_ time and locale is 'en-US':
|
||||
|
||||
{{ dateObj | date }} // output is 'Jun 15, 2015'
|
||||
{{ dateObj | date:'medium' }} // output is 'Jun 15, 2015, 9:43:11 PM'
|
||||
{{ dateObj | date:'shortTime' }} // output is '9:43 PM'
|
||||
{{ dateObj | date:'mmss' }} // output is '43:11'
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-sub-section
|
||||
h3.annotation Pipe
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Pipe({name: 'date'})
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3.annotation Injectable
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Injectable()
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#transform transform
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
transform(value: any, args: any[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#supports supports
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
supports(obj: any)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,171 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/debug/debug_element.ts#L9-L137">angular2/src/core/debug/debug_element.ts (line 9)</a>
|
||||
|
||||
:markdown
|
||||
A DebugElement contains information from the Angular compiler about an
|
||||
element and provides access to the corresponding ElementInjector and
|
||||
underlying dom Element, as well as a way to query for children.
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#componentInstance componentInstance
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#nativeElement nativeElement
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#elementRef elementRef
|
||||
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#getDirectiveInstance getDirectiveInstance
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getDirectiveInstance(directiveIndex: number)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#children children
|
||||
|
||||
|
||||
:markdown
|
||||
Get child DebugElements from within the Light DOM.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#componentViewChildren componentViewChildren
|
||||
|
||||
|
||||
:markdown
|
||||
Get the root DebugElement children of a component. Returns an empty
|
||||
list if the current DebugElement is not a component root.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#triggerEventHandler triggerEventHandler
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
triggerEventHandler(eventName: string, eventObj: Event)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#hasDirective hasDirective
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
hasDirective(type: Type)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#inject inject
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
inject(type: Type)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#getLocal getLocal
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
getLocal(name: string)
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#query query
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
query(predicate: Predicate<DebugElement>, scope?: Function)
|
||||
|
||||
:markdown
|
||||
Return the first descendant TestElement matching the given predicate
|
||||
and scope.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3#queryAll queryAll
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
queryAll(predicate: Predicate<DebugElement>, scope?: Function)
|
||||
|
||||
:markdown
|
||||
Return descendant TestElememts matching the given predicate
|
||||
and scope.
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
|
||||
p.location-badge.
|
||||
exported from <a href='../core'>angular2/core</a>
|
||||
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/pipes/number_pipe.ts#L56-L94">angular2/src/core/pipes/number_pipe.ts (line 56)</a>
|
||||
|
||||
:markdown
|
||||
WARNING: this pipe uses the Internationalization API.
|
||||
Therefore it is only reliable in Chrome and Opera browsers.
|
||||
|
||||
Formats a number as local text. i.e. group sizing and seperator and other locale-specific
|
||||
configurations are based on the active locale.
|
||||
|
||||
# Usage
|
||||
|
||||
expression | number[:digitInfo]
|
||||
|
||||
where `expression` is a number and `digitInfo` has the following format:
|
||||
|
||||
{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
|
||||
|
||||
- minIntegerDigits is the minimum number of integer digits to use. Defaults to 1.
|
||||
- minFractionDigits is the minimum number of digits after fraction. Defaults to 0.
|
||||
- maxFractionDigits is the maximum number of digits after fraction. Defaults to 3.
|
||||
|
||||
For more information on the acceptable range for each of these numbers and other
|
||||
details see your native internationalization library.
|
||||
|
||||
# Examples
|
||||
|
||||
{{ 123 | number }} // output is 123
|
||||
{{ 123.1 | number: '.2-3' }} // output is 123.10
|
||||
{{ 1 | number: '2.2' }} // output is 01.00
|
||||
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Annotations
|
||||
.l-sub-section
|
||||
h3.annotation Pipe
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Pipe({name: 'number'})
|
||||
|
||||
|
||||
.l-sub-section
|
||||
h3.annotation Injectable
|
||||
pre.prettyprint
|
||||
code.
|
||||
@Injectable()
|
||||
|
||||
|
||||
.l-main-section
|
||||
h2 Members
|
||||
.l-sub-section
|
||||
h3#transform transform
|
||||
|
||||
|
||||
pre.prettyprint
|
||||
code.
|
||||
transform(value: any, args: any[])
|
||||
|
||||
:markdown
|
||||
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue