cleanup angular2-product example
This commit is contained in:
parent
5e9f3b32fc
commit
71cfa11d2f
9320 changed files with 0 additions and 1467631 deletions
|
@ -1,69 +0,0 @@
|
|||
System.register(['angular2/http', 'angular2/core', 'rxjs/Observable', './keycloak'], function(exports_1) {
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var http_1, core_1, Observable_1, keycloak_1;
|
||||
var AppComponent;
|
||||
return {
|
||||
setters:[
|
||||
function (http_1_1) {
|
||||
http_1 = http_1_1;
|
||||
},
|
||||
function (core_1_1) {
|
||||
core_1 = core_1_1;
|
||||
},
|
||||
function (Observable_1_1) {
|
||||
Observable_1 = Observable_1_1;
|
||||
},
|
||||
function (keycloak_1_1) {
|
||||
keycloak_1 = keycloak_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
AppComponent = (function () {
|
||||
function AppComponent(_kc, http) {
|
||||
this._kc = _kc;
|
||||
this.http = http;
|
||||
this.products = [];
|
||||
}
|
||||
AppComponent.prototype.logout = function () {
|
||||
this._kc.logout();
|
||||
};
|
||||
AppComponent.prototype.reloadData = function () {
|
||||
//angular dont have http interceptor yet
|
||||
var _this = this;
|
||||
this._kc.getToken().then(function (token) {
|
||||
var headers = new http_1.Headers({
|
||||
'Accept': 'application/json',
|
||||
'Authorization': 'Bearer ' + token
|
||||
});
|
||||
var options = new http_1.RequestOptions({ headers: headers });
|
||||
_this.http.get('/database/products', options)
|
||||
.map(function (res) { return res.json(); })
|
||||
.subscribe(function (prods) { return _this.products = prods; }, function (error) { return console.log(error); });
|
||||
}, function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
};
|
||||
AppComponent.prototype.handleError = function (error) {
|
||||
console.error(error);
|
||||
return Observable_1.Observable.throw(error.json().error || 'Server error');
|
||||
};
|
||||
AppComponent = __decorate([
|
||||
core_1.Component({
|
||||
selector: 'my-app',
|
||||
template: "\n<div id=\"content-area\" class=\"col-md-9\" role=\"main\">\n <div id=\"content\">\n <h1>Angular2 Product (Beta)</h1>\n <h2><span>Products</span></h2>\n \n <button type=\"button\" (click)=\"logout()\">Sign Out</button>\n <button type=\"button\" (click)=\"reloadData()\">Reload</button>\n <table class=\"table\" [hidden]=\"!products.length\">\n <thead>\n <tr>\n <th>Product Listing</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"#p of products\">\n <td>{{p}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>\n"
|
||||
}),
|
||||
__metadata('design:paramtypes', [keycloak_1.KeycloakService, http_1.Http])
|
||||
], AppComponent);
|
||||
return AppComponent;
|
||||
})();
|
||||
exports_1("AppComponent", AppComponent);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"app.js","sourceRoot":"","names":["AppComponent","AppComponent.constructor","AppComponent.logout","AppComponent.reloadData"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;YAOA;gBA0BIA,sBAAoBA,GAAmBA,EAAUA,IAASA;oBAAtCC,QAAGA,GAAHA,GAAGA,CAAgBA;oBAAUA,SAAIA,GAAJA,IAAIA,CAAKA;gBAAGA,CAACA;gBAI9DD,6BAAMA,GAANA;oBACIE,IAAIA,CAACA,GAAGA,CAACA,MAAMA,EAAEA,CAACA;gBACtBA,CAACA;gBAEDF,iCAAUA,GAAVA;oBACIG,wCAAwCA;oBAD5CA,iBAuBCA;oBApBGA,IAAIA,CAACA,GAAGA,CAACA,QAAQA,EAAEA,CAACA,IAAIA,CACpBA,UAACA,KAAKA;wBAEFA,IAAIA,OAAOA,GAAGA,IAAIA,cAAOA,CAACA;4BAClBA,cAAcA,EAAEA,kBAAkBA;4BAClCA,aAAaA,EAAEA,SAASA,GAAGA,KAAKA;yBACnCA,CAACA,CAACA;wBAEPA,IAAIA,OAAOA,GAAGA,IAAIA,qBAAcA,CAACA,EAAEA,OAAOA,EAAEA,OAAOA,EAAEA,CAACA,CAACA;wBAEvDA,KAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,oBAAoBA,EAAEA,OAAOA,CAACA;6BACvCA,GAAGA,CAACA,UAAAA,GAAGA,IAAIA,OAAWA,GAAGA,CAACA,IAAIA,EAAEA,CAACA,IAAIA,EAA1BA,CAA0BA,CAACA;6BACtCA,EAAEA,CAACA,UAAAA,IAAIA,IAAGA,OAAAA,KAAIA,CAACA,QAAQA,GAAGA,IAAIA,EAApBA,CAAoBA,CAACA,CAACA;wBACjCA,2BAA2BA;oBACnCA,CAACA,EACDA,UAACA,KAAKA;wBACFA,OAAOA,CAACA,GAAGA,CAACA,KAAKA,CAACA,CAACA;oBACvBA,CAACA,CACJA,CAACA;gBAENA,CAACA;gBAzDLH;oBAACA,gBAASA,CAACA;wBACPA,QAAQA,EAAEA,QAAQA;wBAClBA,QAAQA,EACZA,mmBAoBCA;qBACAA,CAACA;;iCAwCDA;gBAADA,mBAACA;YAADA,CAACA,AAhED,IAgEC;YAhED,uCAgEC,CAAA"}
|
|
@ -1,66 +0,0 @@
|
|||
System.register(['angular2/core'], function(exports_1) {
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var core_1;
|
||||
var KeycloakService;
|
||||
return {
|
||||
setters:[
|
||||
function (core_1_1) {
|
||||
core_1 = core_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
KeycloakService = (function () {
|
||||
function KeycloakService() {
|
||||
}
|
||||
KeycloakService.init = function () {
|
||||
var keycloakAuth = new Keycloak('keycloak.json');
|
||||
KeycloakService.auth.loggedIn = false;
|
||||
return new Promise(function (resolve, reject) {
|
||||
keycloakAuth.init({ onLoad: 'login-required' })
|
||||
.success(function () {
|
||||
KeycloakService.auth.loggedIn = true;
|
||||
KeycloakService.auth.authz = keycloakAuth;
|
||||
KeycloakService.auth.logoutUrl = keycloakAuth.authServerUrl + "/realms/demo/tokens/logout?redirect_uri=/angular2-product/index.html";
|
||||
resolve(null);
|
||||
})
|
||||
.error(function () {
|
||||
reject(null);
|
||||
});
|
||||
});
|
||||
};
|
||||
KeycloakService.prototype.logout = function () {
|
||||
console.log('*** LOGOUT');
|
||||
KeycloakService.auth.loggedIn = false;
|
||||
KeycloakService.auth.authz = null;
|
||||
window.location.href = KeycloakService.auth.logoutUrl;
|
||||
};
|
||||
KeycloakService.prototype.getToken = function () {
|
||||
return new Promise(function (resolve, reject) {
|
||||
if (KeycloakService.auth.authz.token) {
|
||||
KeycloakService.auth.authz.updateToken(5).success(function () {
|
||||
resolve(KeycloakService.auth.authz.token);
|
||||
})
|
||||
.error(function () {
|
||||
reject('Failed to refresh token');
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
KeycloakService.auth = {};
|
||||
KeycloakService = __decorate([
|
||||
core_1.Injectable(),
|
||||
__metadata('design:paramtypes', [])
|
||||
], KeycloakService);
|
||||
return KeycloakService;
|
||||
})();
|
||||
exports_1("KeycloakService", KeycloakService);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"keycloak.js","sourceRoot":"","names":["KeycloakService","KeycloakService.constructor","KeycloakService.init","KeycloakService.logout","KeycloakService.getToken"],"mappings":";;;;;;;;;;;;;;;;;;YAOA,sCAAsC;YACtC,kCAAkC;YAGlC,aAAa;YACb,yBAAyB;YACzB,kBAAkB;YAClB,sBAAsB;YACtB,GAAG;YAKH;gBAKIA;oBACIC,OAAOA,CAACA,GAAGA,CAACA,6BAA6BA,CAACA,CAACA;gBAC/CA,CAACA;gBAEMD,oBAAIA,GAAXA;oBACIE,OAAOA,CAACA,GAAGA,CAACA,uBAAuBA,CAACA,CAACA;oBACrCA,IAAIA,YAAYA,GAASA,IAAIA,QAAQA,CAACA,eAAeA,CAACA,CAACA;oBACvDA,eAAeA,CAACA,IAAIA,CAACA,QAAQA,GAAGA,KAAKA,CAACA;oBAEtCA,MAAMA,CAACA,IAAIA,OAAOA,CAACA,UAACA,OAAOA,EAACA,MAAMA;wBAC9BA,YAAYA,CAACA,IAAIA,CAACA,EAAEA,MAAMA,EAAEA,gBAAgBA,EAAEA,CAACA;6BAC1CA,OAAOA,CAAEA;4BACNA,eAAeA,CAACA,IAAIA,CAACA,QAAQA,GAAGA,IAAIA,CAACA;4BACrCA,eAAeA,CAACA,IAAIA,CAACA,KAAKA,GAAGA,YAAYA,CAACA;4BAC1CA,eAAeA,CAACA,IAAIA,CAACA,SAASA,GAAGA,YAAYA,CAACA,aAAaA,GAAGA,qEAAqEA,CAACA;4BACpIA,OAAOA,CAACA,IAAIA,CAACA,CAACA;wBAClBA,CAACA,CAACA;6BACDA,KAAKA,CAACA;4BACHA,MAAMA,CAACA,IAAIA,CAACA,CAACA;wBACjBA,CAACA,CAACA,CAACA;oBACXA,CAACA,CAACA,CAACA;gBACPA,CAACA;gBAEDF,gCAAMA,GAANA;oBACIG,OAAOA,CAACA,GAAGA,CAACA,YAAYA,CAACA,CAACA;oBAC1BA,eAAeA,CAACA,IAAIA,CAACA,QAAQA,GAAGA,KAAKA,CAACA;oBACtCA,eAAeA,CAACA,IAAIA,CAACA,KAAKA,GAAGA,IAAIA,CAACA;oBAClCA,MAAMA,CAACA,QAAQA,GAAGA,eAAeA,CAACA,IAAIA,CAACA,SAASA,CAACA;gBACrDA,CAACA;gBAEDH,kCAAQA,GAARA;oBACII,MAAMA,CAACA,IAAIA,OAAOA,CAASA,UAACA,OAAOA,EAACA,MAAMA;wBACtCA,EAAEA,CAACA,CAACA,eAAeA,CAACA,IAAIA,CAACA,KAAKA,CAACA,KAAKA,CAACA,CAACA,CAACA;4BACnCA,eAAeA,CAACA,IAAIA,CAACA,KAAKA,CAACA,WAAWA,CAACA,CAACA,CAACA,CAACA,OAAOA,CAACA;gCAC9C,OAAO,CAAS,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;4BACtD,CAAC,CAACA;iCACDA,KAAKA,CAACA;gCACH,MAAM,CAAC,yBAAyB,CAAC,CAAC;4BACtC,CAAC,CAACA,CAACA;wBACPA,CAACA;oBACLA,CAACA,CAACA,CAACA;gBACPA,CAACA;gBA3CMJ,oBAAIA,GAASA,EAAEA,CAACA;gBAH3BA;oBAACA,iBAAUA,EAAEA;;oCA+CZA;gBAADA,sBAACA;YAADA,CAACA,AA/CD,IA+CC;YA/CD,6CA+CC,CAAA"}
|
|
@ -1,26 +0,0 @@
|
|||
System.register(['rxjs/Rx', 'angular2/platform/browser', 'angular2/http', './keycloak', './app'], function(exports_1) {
|
||||
var browser_1, http_1, keycloak_1, app_1;
|
||||
return {
|
||||
setters:[
|
||||
function (_1) {},
|
||||
function (browser_1_1) {
|
||||
browser_1 = browser_1_1;
|
||||
},
|
||||
function (http_1_1) {
|
||||
http_1 = http_1_1;
|
||||
},
|
||||
function (keycloak_1_1) {
|
||||
keycloak_1 = keycloak_1_1;
|
||||
},
|
||||
function (app_1_1) {
|
||||
app_1 = app_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
keycloak_1.KeycloakService.init().then(function (o) {
|
||||
browser_1.bootstrap(app_1.AppComponent, [http_1.HTTP_BINDINGS, keycloak_1.KeycloakService]);
|
||||
}, function (x) {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"main.js","sourceRoot":"","names":[],"mappings":";;;;;;;;;;;;;;;;;YAKA,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACzB,0BAAe,CAAC,IAAI,EAAE,CAAC,IAAI,CACvB;gBACI,mBAAS,CAAC,kBAAY,EAAC,CAAC,oBAAa,CAAC,CAAC,CAAC;YAC5C,CAAC,EACD;gBACI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YAC7B,CAAC,CACJ,CAAC"}
|
|
@ -1 +0,0 @@
|
|||
../browser-sync/bin/browser-sync.js
|
|
@ -1 +0,0 @@
|
|||
../concurrently/src/main.js
|
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/dev-ip
generated
vendored
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/dev-ip
generated
vendored
|
@ -1 +0,0 @@
|
|||
../dev-ip/lib/dev-ip.js
|
|
@ -1 +0,0 @@
|
|||
../express/bin/express
|
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/foxy
generated
vendored
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/foxy
generated
vendored
|
@ -1 +0,0 @@
|
|||
../foxy/cli.js
|
|
@ -1 +0,0 @@
|
|||
../har-validator/bin/har-validator
|
|
@ -1 +0,0 @@
|
|||
../has-ansi/cli.js
|
|
@ -1 +0,0 @@
|
|||
../indent-string/cli.js
|
|
@ -1 +0,0 @@
|
|||
../lite-server/bin/lite-server
|
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/lt
generated
vendored
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/lt
generated
vendored
|
@ -1 +0,0 @@
|
|||
../localtunnel/bin/client
|
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/nopt
generated
vendored
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/nopt
generated
vendored
|
@ -1 +0,0 @@
|
|||
../nopt/bin/nopt.js
|
|
@ -1 +0,0 @@
|
|||
../repeating/cli.js
|
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/rimraf
generated
vendored
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/rimraf
generated
vendored
|
@ -1 +0,0 @@
|
|||
../rimraf/bin.js
|
|
@ -1 +0,0 @@
|
|||
../strip-ansi/cli.js
|
|
@ -1 +0,0 @@
|
|||
../supports-color/cli.js
|
|
@ -1 +0,0 @@
|
|||
../stream-throttle/bin/throttleproxy.js
|
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/tsc
generated
vendored
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/tsc
generated
vendored
|
@ -1 +0,0 @@
|
|||
../typescript/bin/tsc
|
|
@ -1 +0,0 @@
|
|||
../typescript/bin/tsserver
|
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/uuid
generated
vendored
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/uuid
generated
vendored
|
@ -1 +0,0 @@
|
|||
../node-uuid/bin/uuid
|
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/weinre
generated
vendored
1
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/.bin/weinre
generated
vendored
|
@ -1 +0,0 @@
|
|||
../weinre/weinre
|
|
@ -1 +0,0 @@
|
|||
../window-size/cli.js
|
|
@ -1,4 +0,0 @@
|
|||
.nyc_output
|
||||
nyc_output
|
||||
node_modules
|
||||
coverage
|
|
@ -1,5 +0,0 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- '0.10'
|
||||
- '0.12'
|
||||
- 'iojs'
|
|
@ -1,3 +0,0 @@
|
|||
To get started, <a
|
||||
href="http://www.clahub.com/agreements/isaacs/abbrev-js">sign the
|
||||
Contributor License Agreement</a>.
|
15
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/abbrev/LICENSE
generated
vendored
15
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/abbrev/LICENSE
generated
vendored
|
@ -1,15 +0,0 @@
|
|||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@ -1,23 +0,0 @@
|
|||
# abbrev-js
|
||||
|
||||
Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
|
||||
|
||||
Usage:
|
||||
|
||||
var abbrev = require("abbrev");
|
||||
abbrev("foo", "fool", "folding", "flop");
|
||||
|
||||
// returns:
|
||||
{ fl: 'flop'
|
||||
, flo: 'flop'
|
||||
, flop: 'flop'
|
||||
, fol: 'folding'
|
||||
, fold: 'folding'
|
||||
, foldi: 'folding'
|
||||
, foldin: 'folding'
|
||||
, folding: 'folding'
|
||||
, foo: 'foo'
|
||||
, fool: 'fool'
|
||||
}
|
||||
|
||||
This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.
|
|
@ -1,62 +0,0 @@
|
|||
|
||||
module.exports = exports = abbrev.abbrev = abbrev
|
||||
|
||||
abbrev.monkeyPatch = monkeyPatch
|
||||
|
||||
function monkeyPatch () {
|
||||
Object.defineProperty(Array.prototype, 'abbrev', {
|
||||
value: function () { return abbrev(this) },
|
||||
enumerable: false, configurable: true, writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(Object.prototype, 'abbrev', {
|
||||
value: function () { return abbrev(Object.keys(this)) },
|
||||
enumerable: false, configurable: true, writable: true
|
||||
})
|
||||
}
|
||||
|
||||
function abbrev (list) {
|
||||
if (arguments.length !== 1 || !Array.isArray(list)) {
|
||||
list = Array.prototype.slice.call(arguments, 0)
|
||||
}
|
||||
for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
|
||||
args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
|
||||
}
|
||||
|
||||
// sort them lexicographically, so that they're next to their nearest kin
|
||||
args = args.sort(lexSort)
|
||||
|
||||
// walk through each, seeing how much it has in common with the next and previous
|
||||
var abbrevs = {}
|
||||
, prev = ""
|
||||
for (var i = 0, l = args.length ; i < l ; i ++) {
|
||||
var current = args[i]
|
||||
, next = args[i + 1] || ""
|
||||
, nextMatches = true
|
||||
, prevMatches = true
|
||||
if (current === next) continue
|
||||
for (var j = 0, cl = current.length ; j < cl ; j ++) {
|
||||
var curChar = current.charAt(j)
|
||||
nextMatches = nextMatches && curChar === next.charAt(j)
|
||||
prevMatches = prevMatches && curChar === prev.charAt(j)
|
||||
if (!nextMatches && !prevMatches) {
|
||||
j ++
|
||||
break
|
||||
}
|
||||
}
|
||||
prev = current
|
||||
if (j === cl) {
|
||||
abbrevs[current] = current
|
||||
continue
|
||||
}
|
||||
for (var a = current.substr(0, j) ; j <= cl ; j ++) {
|
||||
abbrevs[a] = current
|
||||
a += current.charAt(j)
|
||||
}
|
||||
}
|
||||
return abbrevs
|
||||
}
|
||||
|
||||
function lexSort (a, b) {
|
||||
return a === b ? 0 : a > b ? 1 : -1
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"abbrev@1",
|
||||
"/home/jean/Experiences/angular2-product-app/node_modules/nopt"
|
||||
]
|
||||
],
|
||||
"_from": "abbrev@>=1.0.0 <2.0.0",
|
||||
"_id": "abbrev@1.0.7",
|
||||
"_inCache": true,
|
||||
"_location": "/abbrev",
|
||||
"_nodeVersion": "2.0.1",
|
||||
"_npmUser": {
|
||||
"email": "isaacs@npmjs.com",
|
||||
"name": "isaacs"
|
||||
},
|
||||
"_npmVersion": "2.10.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "abbrev",
|
||||
"raw": "abbrev@1",
|
||||
"rawSpec": "1",
|
||||
"scope": null,
|
||||
"spec": ">=1.0.0 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/nopt"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz",
|
||||
"_shasum": "5b6035b2ee9d4fb5cf859f08a9be81b208491843",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "abbrev@1",
|
||||
"_where": "/home/jean/Experiences/angular2-product-app/node_modules/nopt",
|
||||
"author": {
|
||||
"email": "i@izs.me",
|
||||
"name": "Isaac Z. Schlueter"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/abbrev-js/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Like ruby's abbrev module, but in js",
|
||||
"devDependencies": {
|
||||
"tap": "^1.2.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "5b6035b2ee9d4fb5cf859f08a9be81b208491843",
|
||||
"tarball": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz"
|
||||
},
|
||||
"gitHead": "821d09ce7da33627f91bbd8ed631497ed6f760c2",
|
||||
"homepage": "https://github.com/isaacs/abbrev-js#readme",
|
||||
"installable": true,
|
||||
"license": "ISC",
|
||||
"main": "abbrev.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "isaacs",
|
||||
"email": "i@izs.me"
|
||||
}
|
||||
],
|
||||
"name": "abbrev",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test.js --cov"
|
||||
},
|
||||
"version": "1.0.7"
|
||||
}
|
47
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/abbrev/test.js
generated
vendored
47
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/abbrev/test.js
generated
vendored
|
@ -1,47 +0,0 @@
|
|||
var abbrev = require('./abbrev.js')
|
||||
var assert = require("assert")
|
||||
var util = require("util")
|
||||
|
||||
console.log("TAP version 13")
|
||||
var count = 0
|
||||
|
||||
function test (list, expect) {
|
||||
count++
|
||||
var actual = abbrev(list)
|
||||
assert.deepEqual(actual, expect,
|
||||
"abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+
|
||||
"actual: "+util.inspect(actual))
|
||||
actual = abbrev.apply(exports, list)
|
||||
assert.deepEqual(abbrev.apply(exports, list), expect,
|
||||
"abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+
|
||||
"actual: "+util.inspect(actual))
|
||||
console.log('ok - ' + list.join(' '))
|
||||
}
|
||||
|
||||
test([ "ruby", "ruby", "rules", "rules", "rules" ],
|
||||
{ rub: 'ruby'
|
||||
, ruby: 'ruby'
|
||||
, rul: 'rules'
|
||||
, rule: 'rules'
|
||||
, rules: 'rules'
|
||||
})
|
||||
test(["fool", "foom", "pool", "pope"],
|
||||
{ fool: 'fool'
|
||||
, foom: 'foom'
|
||||
, poo: 'pool'
|
||||
, pool: 'pool'
|
||||
, pop: 'pope'
|
||||
, pope: 'pope'
|
||||
})
|
||||
test(["a", "ab", "abc", "abcd", "abcde", "acde"],
|
||||
{ a: 'a'
|
||||
, ab: 'ab'
|
||||
, abc: 'abc'
|
||||
, abcd: 'abcd'
|
||||
, abcde: 'abcde'
|
||||
, ac: 'acde'
|
||||
, acd: 'acde'
|
||||
, acde: 'acde'
|
||||
})
|
||||
|
||||
console.log("1..%d", count)
|
170
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/accepts/HISTORY.md
generated
vendored
170
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/accepts/HISTORY.md
generated
vendored
|
@ -1,170 +0,0 @@
|
|||
1.2.13 / 2015-09-06
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.6
|
||||
- deps: mime-db@~1.18.0
|
||||
|
||||
1.2.12 / 2015-07-30
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.4
|
||||
- deps: mime-db@~1.16.0
|
||||
|
||||
1.2.11 / 2015-07-16
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.3
|
||||
- deps: mime-db@~1.15.0
|
||||
|
||||
1.2.10 / 2015-07-01
|
||||
===================
|
||||
|
||||
* deps: mime-types@~2.1.2
|
||||
- deps: mime-db@~1.14.0
|
||||
|
||||
1.2.9 / 2015-06-08
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.1
|
||||
- perf: fix deopt during mapping
|
||||
|
||||
1.2.8 / 2015-06-07
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.1.0
|
||||
- deps: mime-db@~1.13.0
|
||||
* perf: avoid argument reassignment & argument slice
|
||||
* perf: avoid negotiator recursive construction
|
||||
* perf: enable strict mode
|
||||
* perf: remove unnecessary bitwise operator
|
||||
|
||||
1.2.7 / 2015-05-10
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.5.3
|
||||
- Fix media type parameter matching to be case-insensitive
|
||||
|
||||
1.2.6 / 2015-05-07
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.11
|
||||
- deps: mime-db@~1.9.1
|
||||
* deps: negotiator@0.5.2
|
||||
- Fix comparing media types with quoted values
|
||||
- Fix splitting media types with quoted commas
|
||||
|
||||
1.2.5 / 2015-03-13
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.10
|
||||
- deps: mime-db@~1.8.0
|
||||
|
||||
1.2.4 / 2015-02-14
|
||||
==================
|
||||
|
||||
* Support Node.js 0.6
|
||||
* deps: mime-types@~2.0.9
|
||||
- deps: mime-db@~1.7.0
|
||||
* deps: negotiator@0.5.1
|
||||
- Fix preference sorting to be stable for long acceptable lists
|
||||
|
||||
1.2.3 / 2015-01-31
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.8
|
||||
- deps: mime-db@~1.6.0
|
||||
|
||||
1.2.2 / 2014-12-30
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.7
|
||||
- deps: mime-db@~1.5.0
|
||||
|
||||
1.2.1 / 2014-12-30
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.5
|
||||
- deps: mime-db@~1.3.1
|
||||
|
||||
1.2.0 / 2014-12-19
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.5.0
|
||||
- Fix list return order when large accepted list
|
||||
- Fix missing identity encoding when q=0 exists
|
||||
- Remove dynamic building of Negotiator class
|
||||
|
||||
1.1.4 / 2014-12-10
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.4
|
||||
- deps: mime-db@~1.3.0
|
||||
|
||||
1.1.3 / 2014-11-09
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.3
|
||||
- deps: mime-db@~1.2.0
|
||||
|
||||
1.1.2 / 2014-10-14
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.4.9
|
||||
- Fix error when media type has invalid parameter
|
||||
|
||||
1.1.1 / 2014-09-28
|
||||
==================
|
||||
|
||||
* deps: mime-types@~2.0.2
|
||||
- deps: mime-db@~1.1.0
|
||||
* deps: negotiator@0.4.8
|
||||
- Fix all negotiations to be case-insensitive
|
||||
- Stable sort preferences of same quality according to client order
|
||||
|
||||
1.1.0 / 2014-09-02
|
||||
==================
|
||||
|
||||
* update `mime-types`
|
||||
|
||||
1.0.7 / 2014-07-04
|
||||
==================
|
||||
|
||||
* Fix wrong type returned from `type` when match after unknown extension
|
||||
|
||||
1.0.6 / 2014-06-24
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.4.7
|
||||
|
||||
1.0.5 / 2014-06-20
|
||||
==================
|
||||
|
||||
* fix crash when unknown extension given
|
||||
|
||||
1.0.4 / 2014-06-19
|
||||
==================
|
||||
|
||||
* use `mime-types`
|
||||
|
||||
1.0.3 / 2014-06-11
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.4.6
|
||||
- Order by specificity when quality is the same
|
||||
|
||||
1.0.2 / 2014-05-29
|
||||
==================
|
||||
|
||||
* Fix interpretation when header not in request
|
||||
* deps: pin negotiator@0.4.5
|
||||
|
||||
1.0.1 / 2014-01-18
|
||||
==================
|
||||
|
||||
* Identity encoding isn't always acceptable
|
||||
* deps: negotiator@~0.4.0
|
||||
|
||||
1.0.0 / 2013-12-27
|
||||
==================
|
||||
|
||||
* Genesis
|
23
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/accepts/LICENSE
generated
vendored
23
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/accepts/LICENSE
generated
vendored
|
@ -1,23 +0,0 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
135
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/accepts/README.md
generated
vendored
135
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/accepts/README.md
generated
vendored
|
@ -1,135 +0,0 @@
|
|||
# accepts
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Node.js Version][node-version-image]][node-version-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). Extracted from [koa](https://www.npmjs.com/package/koa) for general use.
|
||||
|
||||
In addition to negotiator, it allows:
|
||||
|
||||
- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` as well as `('text/html', 'application/json')`.
|
||||
- Allows type shorthands such as `json`.
|
||||
- Returns `false` when no types match
|
||||
- Treats non-existent headers as `*`
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install accepts
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var accepts = require('accepts')
|
||||
```
|
||||
|
||||
### accepts(req)
|
||||
|
||||
Create a new `Accepts` object for the given `req`.
|
||||
|
||||
#### .charset(charsets)
|
||||
|
||||
Return the first accepted charset. If nothing in `charsets` is accepted,
|
||||
then `false` is returned.
|
||||
|
||||
#### .charsets()
|
||||
|
||||
Return the charsets that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
#### .encoding(encodings)
|
||||
|
||||
Return the first accepted encoding. If nothing in `encodings` is accepted,
|
||||
then `false` is returned.
|
||||
|
||||
#### .encodings()
|
||||
|
||||
Return the encodings that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
#### .language(languages)
|
||||
|
||||
Return the first accepted language. If nothing in `languages` is accepted,
|
||||
then `false` is returned.
|
||||
|
||||
#### .languages()
|
||||
|
||||
Return the languages that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
#### .type(types)
|
||||
|
||||
Return the first accepted type (and it is returned as the same text as what
|
||||
appears in the `types` array). If nothing in `types` is accepted, then `false`
|
||||
is returned.
|
||||
|
||||
The `types` array can contain full MIME types or file extensions. Any value
|
||||
that is not a full MIME types is passed to `require('mime-types').lookup`.
|
||||
|
||||
#### .types()
|
||||
|
||||
Return the types that the request accepts, in the order of the client's
|
||||
preference (most preferred first).
|
||||
|
||||
## Examples
|
||||
|
||||
### Simple type negotiation
|
||||
|
||||
This simple example shows how to use `accepts` to return a different typed
|
||||
respond body based on what the client wants to accept. The server lists it's
|
||||
preferences in order and will get back the best match between the client and
|
||||
server.
|
||||
|
||||
```js
|
||||
var accepts = require('accepts')
|
||||
var http = require('http')
|
||||
|
||||
function app(req, res) {
|
||||
var accept = accepts(req)
|
||||
|
||||
// the order of this list is significant; should be server preferred order
|
||||
switch(accept.type(['json', 'html'])) {
|
||||
case 'json':
|
||||
res.setHeader('Content-Type', 'application/json')
|
||||
res.write('{"hello":"world!"}')
|
||||
break
|
||||
case 'html':
|
||||
res.setHeader('Content-Type', 'text/html')
|
||||
res.write('<b>hello, world!</b>')
|
||||
break
|
||||
default:
|
||||
// the fallback is text/plain, so no need to specify it above
|
||||
res.setHeader('Content-Type', 'text/plain')
|
||||
res.write('hello, world!')
|
||||
break
|
||||
}
|
||||
|
||||
res.end()
|
||||
}
|
||||
|
||||
http.createServer(app).listen(3000)
|
||||
```
|
||||
|
||||
You can test this out with the cURL program:
|
||||
```sh
|
||||
curl -I -H'Accept: text/html' http://localhost:3000/
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/accepts.svg
|
||||
[npm-url]: https://npmjs.org/package/accepts
|
||||
[node-version-image]: https://img.shields.io/node/v/accepts.svg
|
||||
[node-version-url]: http://nodejs.org/download/
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/accepts/master.svg
|
||||
[travis-url]: https://travis-ci.org/jshttp/accepts
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/accepts
|
||||
[downloads-image]: https://img.shields.io/npm/dm/accepts.svg
|
||||
[downloads-url]: https://npmjs.org/package/accepts
|
231
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/accepts/index.js
generated
vendored
231
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/accepts/index.js
generated
vendored
|
@ -1,231 +0,0 @@
|
|||
/*!
|
||||
* accepts
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var Negotiator = require('negotiator')
|
||||
var mime = require('mime-types')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = Accepts
|
||||
|
||||
/**
|
||||
* Create a new Accepts object for the given req.
|
||||
*
|
||||
* @param {object} req
|
||||
* @public
|
||||
*/
|
||||
|
||||
function Accepts(req) {
|
||||
if (!(this instanceof Accepts))
|
||||
return new Accepts(req)
|
||||
|
||||
this.headers = req.headers
|
||||
this.negotiator = new Negotiator(req)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given `type(s)` is acceptable, returning
|
||||
* the best match when true, otherwise `undefined`, in which
|
||||
* case you should respond with 406 "Not Acceptable".
|
||||
*
|
||||
* The `type` value may be a single mime type string
|
||||
* such as "application/json", the extension name
|
||||
* such as "json" or an array `["json", "html", "text/plain"]`. When a list
|
||||
* or array is given the _best_ match, if any is returned.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* // Accept: text/html
|
||||
* this.types('html');
|
||||
* // => "html"
|
||||
*
|
||||
* // Accept: text/*, application/json
|
||||
* this.types('html');
|
||||
* // => "html"
|
||||
* this.types('text/html');
|
||||
* // => "text/html"
|
||||
* this.types('json', 'text');
|
||||
* // => "json"
|
||||
* this.types('application/json');
|
||||
* // => "application/json"
|
||||
*
|
||||
* // Accept: text/*, application/json
|
||||
* this.types('image/png');
|
||||
* this.types('png');
|
||||
* // => undefined
|
||||
*
|
||||
* // Accept: text/*;q=.5, application/json
|
||||
* this.types(['html', 'json']);
|
||||
* this.types('html', 'json');
|
||||
* // => "json"
|
||||
*
|
||||
* @param {String|Array} types...
|
||||
* @return {String|Array|Boolean}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.type =
|
||||
Accepts.prototype.types = function (types_) {
|
||||
var types = types_
|
||||
|
||||
// support flattened arguments
|
||||
if (types && !Array.isArray(types)) {
|
||||
types = new Array(arguments.length)
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
types[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no types, return all requested types
|
||||
if (!types || types.length === 0) {
|
||||
return this.negotiator.mediaTypes()
|
||||
}
|
||||
|
||||
if (!this.headers.accept) return types[0];
|
||||
var mimes = types.map(extToMime);
|
||||
var accepts = this.negotiator.mediaTypes(mimes.filter(validMime));
|
||||
var first = accepts[0];
|
||||
if (!first) return false;
|
||||
return types[mimes.indexOf(first)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return accepted encodings or best fit based on `encodings`.
|
||||
*
|
||||
* Given `Accept-Encoding: gzip, deflate`
|
||||
* an array sorted by quality is returned:
|
||||
*
|
||||
* ['gzip', 'deflate']
|
||||
*
|
||||
* @param {String|Array} encodings...
|
||||
* @return {String|Array}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.encoding =
|
||||
Accepts.prototype.encodings = function (encodings_) {
|
||||
var encodings = encodings_
|
||||
|
||||
// support flattened arguments
|
||||
if (encodings && !Array.isArray(encodings)) {
|
||||
encodings = new Array(arguments.length)
|
||||
for (var i = 0; i < encodings.length; i++) {
|
||||
encodings[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no encodings, return all requested encodings
|
||||
if (!encodings || encodings.length === 0) {
|
||||
return this.negotiator.encodings()
|
||||
}
|
||||
|
||||
return this.negotiator.encodings(encodings)[0] || false
|
||||
}
|
||||
|
||||
/**
|
||||
* Return accepted charsets or best fit based on `charsets`.
|
||||
*
|
||||
* Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
|
||||
* an array sorted by quality is returned:
|
||||
*
|
||||
* ['utf-8', 'utf-7', 'iso-8859-1']
|
||||
*
|
||||
* @param {String|Array} charsets...
|
||||
* @return {String|Array}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.charset =
|
||||
Accepts.prototype.charsets = function (charsets_) {
|
||||
var charsets = charsets_
|
||||
|
||||
// support flattened arguments
|
||||
if (charsets && !Array.isArray(charsets)) {
|
||||
charsets = new Array(arguments.length)
|
||||
for (var i = 0; i < charsets.length; i++) {
|
||||
charsets[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no charsets, return all requested charsets
|
||||
if (!charsets || charsets.length === 0) {
|
||||
return this.negotiator.charsets()
|
||||
}
|
||||
|
||||
return this.negotiator.charsets(charsets)[0] || false
|
||||
}
|
||||
|
||||
/**
|
||||
* Return accepted languages or best fit based on `langs`.
|
||||
*
|
||||
* Given `Accept-Language: en;q=0.8, es, pt`
|
||||
* an array sorted by quality is returned:
|
||||
*
|
||||
* ['es', 'pt', 'en']
|
||||
*
|
||||
* @param {String|Array} langs...
|
||||
* @return {Array|String}
|
||||
* @public
|
||||
*/
|
||||
|
||||
Accepts.prototype.lang =
|
||||
Accepts.prototype.langs =
|
||||
Accepts.prototype.language =
|
||||
Accepts.prototype.languages = function (languages_) {
|
||||
var languages = languages_
|
||||
|
||||
// support flattened arguments
|
||||
if (languages && !Array.isArray(languages)) {
|
||||
languages = new Array(arguments.length)
|
||||
for (var i = 0; i < languages.length; i++) {
|
||||
languages[i] = arguments[i]
|
||||
}
|
||||
}
|
||||
|
||||
// no languages, return all requested languages
|
||||
if (!languages || languages.length === 0) {
|
||||
return this.negotiator.languages()
|
||||
}
|
||||
|
||||
return this.negotiator.languages(languages)[0] || false
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert extnames to mime.
|
||||
*
|
||||
* @param {String} type
|
||||
* @return {String}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function extToMime(type) {
|
||||
return type.indexOf('/') === -1
|
||||
? mime.lookup(type)
|
||||
: type
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if mime is valid.
|
||||
*
|
||||
* @param {String} type
|
||||
* @return {String}
|
||||
* @private
|
||||
*/
|
||||
|
||||
function validMime(type) {
|
||||
return typeof type === 'string';
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"accepts@~1.2.13",
|
||||
"/home/jean/Experiences/angular2-product-app/node_modules/serve-index"
|
||||
]
|
||||
],
|
||||
"_from": "accepts@>=1.2.13 <1.3.0",
|
||||
"_id": "accepts@1.2.13",
|
||||
"_inCache": true,
|
||||
"_location": "/accepts",
|
||||
"_npmUser": {
|
||||
"email": "doug@somethingdoug.com",
|
||||
"name": "dougwilson"
|
||||
},
|
||||
"_npmVersion": "1.4.28",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "accepts",
|
||||
"raw": "accepts@~1.2.13",
|
||||
"rawSpec": "~1.2.13",
|
||||
"scope": null,
|
||||
"spec": ">=1.2.13 <1.3.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/serve-index"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz",
|
||||
"_shasum": "e5f1f3928c6d95fd96558c36ec3d9d0de4a6ecea",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "accepts@~1.2.13",
|
||||
"_where": "/home/jean/Experiences/angular2-product-app/node_modules/serve-index",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/accepts/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"mime-types": "~2.1.6",
|
||||
"negotiator": "0.5.3"
|
||||
},
|
||||
"description": "Higher-level content negotiation",
|
||||
"devDependencies": {
|
||||
"istanbul": "0.3.19",
|
||||
"mocha": "~1.21.5"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "e5f1f3928c6d95fd96558c36ec3d9d0de4a6ecea",
|
||||
"tarball": "http://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"files": [
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "b7e15ecb25dacc0b2133ed0553d64f8a79537e01",
|
||||
"homepage": "https://github.com/jshttp/accepts",
|
||||
"installable": true,
|
||||
"keywords": [
|
||||
"accept",
|
||||
"accepts",
|
||||
"content",
|
||||
"negotiation"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "jongleberry",
|
||||
"email": "jonathanrichardong@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "federomero",
|
||||
"email": "federomero@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "dougwilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "fishrock123",
|
||||
"email": "fishrock123@rocketmail.com"
|
||||
},
|
||||
{
|
||||
"name": "tjholowaychuk",
|
||||
"email": "tj@vision-media.ca"
|
||||
},
|
||||
{
|
||||
"name": "mscdex",
|
||||
"email": "mscdex@mscdex.net"
|
||||
},
|
||||
{
|
||||
"name": "defunctzombie",
|
||||
"email": "shtylman@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "accepts",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jshttp/accepts"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha --reporter spec --check-leaks --bail test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
|
||||
},
|
||||
"version": "1.2.13"
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
node_modules
|
||||
.monitor
|
|
@ -1,5 +0,0 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- 0.6
|
||||
- 0.8
|
||||
- 0.9
|
19
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/after/LICENCE
generated
vendored
19
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/after/LICENCE
generated
vendored
|
@ -1,19 +0,0 @@
|
|||
Copyright (c) 2011 Raynos.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
75
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/after/README.md
generated
vendored
75
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/after/README.md
generated
vendored
|
@ -1,75 +0,0 @@
|
|||
# After [![Build Status][1]][2]
|
||||
|
||||
Invoke callback after n calls
|
||||
|
||||
## Status: production ready
|
||||
|
||||
## Example
|
||||
|
||||
var after = require("after")
|
||||
, next = after(3, logItWorks)
|
||||
|
||||
next()
|
||||
next()
|
||||
next() // it works
|
||||
|
||||
function logItWorks() {
|
||||
console.log("it works!")
|
||||
}
|
||||
|
||||
## Example with error handling
|
||||
|
||||
var after = require("after")
|
||||
, next = after(3, logError)
|
||||
|
||||
next()
|
||||
next(new Error("oops")) // logs oops
|
||||
next() // does nothing
|
||||
|
||||
function logError(err) {
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
## After < 0.6.0
|
||||
|
||||
Older versions of after had iterators and flows in them.
|
||||
|
||||
These have been replaced with seperate modules
|
||||
|
||||
- [iterators][8]
|
||||
- [composite][9]
|
||||
|
||||
## Installation
|
||||
|
||||
`npm install after`
|
||||
|
||||
## Tests
|
||||
|
||||
`npm test`
|
||||
|
||||
## Blog post
|
||||
|
||||
- [Flow control in node.js][3]
|
||||
|
||||
## Examples :
|
||||
|
||||
- [Determining the end of asynchronous operations][4]
|
||||
- [In javascript what are best practices for executing multiple asynchronous functions][5]
|
||||
- [JavaScript performance long running tasks][6]
|
||||
- [Synchronous database queries with node.js][7]
|
||||
|
||||
## Contributors
|
||||
|
||||
- Raynos
|
||||
|
||||
## MIT Licenced
|
||||
|
||||
[1]: https://secure.travis-ci.org/Raynos/after.png
|
||||
[2]: http://travis-ci.org/Raynos/after
|
||||
[3]: http://raynos.org/blog/2/Flow-control-in-node.js
|
||||
[4]: http://stackoverflow.com/questions/6852059/determining-the-end-of-asynchronous-operations-javascript/6852307#6852307
|
||||
[5]: http://stackoverflow.com/questions/6869872/in-javascript-what-are-best-practices-for-executing-multiple-asynchronous-functi/6870031#6870031
|
||||
[6]: http://stackoverflow.com/questions/6864397/javascript-performance-long-running-tasks/6889419#6889419
|
||||
[7]: http://stackoverflow.com/questions/6597493/synchronous-database-queries-with-node-js/6620091#6620091
|
||||
[8]: http://github.com/Raynos/iterators
|
||||
[9]: http://github.com/Raynos/composite
|
28
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/after/index.js
generated
vendored
28
examples/demo-template/angular2-product-app/src/main/webapp/node_modules/after/index.js
generated
vendored
|
@ -1,28 +0,0 @@
|
|||
module.exports = after
|
||||
|
||||
function after(count, callback, err_cb) {
|
||||
var bail = false
|
||||
err_cb = err_cb || noop
|
||||
proxy.count = count
|
||||
|
||||
return (count === 0) ? callback() : proxy
|
||||
|
||||
function proxy(err, result) {
|
||||
if (proxy.count <= 0) {
|
||||
throw new Error('after called too many times')
|
||||
}
|
||||
--proxy.count
|
||||
|
||||
// after first error, rest are passed to err_cb
|
||||
if (err) {
|
||||
bail = true
|
||||
callback(err)
|
||||
// future error callbacks will go to error handler
|
||||
callback = err_cb
|
||||
} else if (proxy.count === 0 && !bail) {
|
||||
callback(null, result)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function noop() {}
|
|
@ -1,86 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"after@0.8.1",
|
||||
"/home/jean/Experiences/angular2-product-app/node_modules/engine.io-parser"
|
||||
]
|
||||
],
|
||||
"_from": "after@0.8.1",
|
||||
"_id": "after@0.8.1",
|
||||
"_inCache": true,
|
||||
"_location": "/after",
|
||||
"_npmUser": {
|
||||
"email": "raynos2@gmail.com",
|
||||
"name": "raynos"
|
||||
},
|
||||
"_npmVersion": "1.2.25",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "after",
|
||||
"raw": "after@0.8.1",
|
||||
"rawSpec": "0.8.1",
|
||||
"scope": null,
|
||||
"spec": "0.8.1",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/engine.io-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/after/-/after-0.8.1.tgz",
|
||||
"_shasum": "ab5d4fb883f596816d3515f8f791c0af486dd627",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "after@0.8.1",
|
||||
"_where": "/home/jean/Experiences/angular2-product-app/node_modules/engine.io-parser",
|
||||
"author": {
|
||||
"email": "raynos2@gmail.com",
|
||||
"name": "Raynos"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Raynos/after/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Raynos",
|
||||
"email": "raynos2@gmail.com",
|
||||
"url": "http://raynos.org"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "after - tiny flow control",
|
||||
"devDependencies": {
|
||||
"mocha": "~1.8.1"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "ab5d4fb883f596816d3515f8f791c0af486dd627",
|
||||
"tarball": "http://registry.npmjs.org/after/-/after-0.8.1.tgz"
|
||||
},
|
||||
"installable": true,
|
||||
"keywords": [
|
||||
"after",
|
||||
"arch",
|
||||
"control",
|
||||
"flow",
|
||||
"flowcontrol"
|
||||
],
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "raynos",
|
||||
"email": "raynos2@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "shtylman",
|
||||
"email": "shtylman@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "after",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Raynos/after.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha --ui tdd --reporter spec test/*.js"
|
||||
},
|
||||
"version": "0.8.1"
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
/*global suite, test*/
|
||||
|
||||
var assert = require("assert")
|
||||
, after = require("../")
|
||||
|
||||
test("exists", function () {
|
||||
assert(typeof after === "function", "after is not a function")
|
||||
})
|
||||
|
||||
test("after when called with 0 invokes", function (done) {
|
||||
after(0, done)
|
||||
});
|
||||
|
||||
test("after 1", function (done) {
|
||||
var next = after(1, done)
|
||||
next()
|
||||
})
|
||||
|
||||
test("after 5", function (done) {
|
||||
var next = after(5, done)
|
||||
, i = 5
|
||||
|
||||
while (i--) {
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
test("manipulate count", function (done) {
|
||||
var next = after(1, done)
|
||||
, i = 5
|
||||
|
||||
next.count = i
|
||||
while (i--) {
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
test("after terminates on error", function (done) {
|
||||
var next = after(2, function(err) {
|
||||
assert.equal(err.message, 'test');
|
||||
done();
|
||||
})
|
||||
next(new Error('test'))
|
||||
next(new Error('test2'))
|
||||
})
|
||||
|
||||
test('gee', function(done) {
|
||||
done = after(2, done)
|
||||
|
||||
function cb(err) {
|
||||
assert.equal(err.message, 1);
|
||||
done()
|
||||
}
|
||||
|
||||
var next = after(3, cb, function(err) {
|
||||
assert.equal(err.message, 2)
|
||||
done()
|
||||
});
|
||||
|
||||
next()
|
||||
next(new Error(1))
|
||||
next(new Error(2))
|
||||
})
|
||||
|
||||
test('eee', function(done) {
|
||||
done = after(3, done)
|
||||
|
||||
function cb(err) {
|
||||
assert.equal(err.message, 1);
|
||||
done()
|
||||
}
|
||||
|
||||
var next = after(3, cb, function(err) {
|
||||
assert.equal(err.message, 2)
|
||||
done()
|
||||
});
|
||||
|
||||
next(new Error(1))
|
||||
next(new Error(2))
|
||||
next(new Error(2))
|
||||
})
|
||||
|
||||
test('gge', function(done) {
|
||||
function cb(err) {
|
||||
assert.equal(err.message, 1);
|
||||
done()
|
||||
}
|
||||
|
||||
var next = after(3, cb, function(err) {
|
||||
// should not happen
|
||||
assert.ok(false);
|
||||
});
|
||||
|
||||
next()
|
||||
next()
|
||||
next(new Error(1))
|
||||
})
|
||||
|
||||
test('egg', function(done) {
|
||||
function cb(err) {
|
||||
assert.equal(err.message, 1);
|
||||
done()
|
||||
}
|
||||
|
||||
var next = after(3, cb, function(err) {
|
||||
// should not happen
|
||||
assert.ok(false);
|
||||
});
|
||||
|
||||
next(new Error(1))
|
||||
next()
|
||||
next()
|
||||
})
|
||||
|
||||
test('throws on too many calls', function(done) {
|
||||
var next = after(1, done);
|
||||
next()
|
||||
assert.throws(next, /after called too many times/);
|
||||
});
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License
|
||||
|
||||
Copyright (c) 2014-2016 Google, Inc. http://angular.io
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
|
@ -1,15 +0,0 @@
|
|||
Angular2
|
||||
=========
|
||||
|
||||
The sources for this package are in the main [Angular2](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo. This is the repository for the upcoming 2.0 version. If you're looking for the current official version of Angular you should go to [angular/angular.js](https://github.com/angular/angular.js)
|
||||
|
||||
This package contains different sources for different users:
|
||||
|
||||
1. The files located in the root folder can be consumed using CommonJS.
|
||||
2. The files under `/es6` are es6 compatible files that can be transpiled to
|
||||
es5 using any transpiler. This contains:
|
||||
* `dev/`: a development version that includes runtime type assertions
|
||||
* `prod/`: a production version that does not include runtime type assertions
|
||||
3. The files under `/ts` are the TypeScript source files.
|
||||
|
||||
License: Apache MIT 2.0
|
|
@ -1,5 +0,0 @@
|
|||
export { Animation } from './src/animate/animation';
|
||||
export { AnimationBuilder } from './src/animate/animation_builder';
|
||||
export { BrowserDetails } from './src/animate/browser_details';
|
||||
export { CssAnimationBuilder } from './src/animate/css_animation_builder';
|
||||
export { CssAnimationOptions } from './src/animate/css_animation_options';
|
|
@ -1,11 +0,0 @@
|
|||
'use strict';var animation_1 = require('./src/animate/animation');
|
||||
exports.Animation = animation_1.Animation;
|
||||
var animation_builder_1 = require('./src/animate/animation_builder');
|
||||
exports.AnimationBuilder = animation_builder_1.AnimationBuilder;
|
||||
var browser_details_1 = require('./src/animate/browser_details');
|
||||
exports.BrowserDetails = browser_details_1.BrowserDetails;
|
||||
var css_animation_builder_1 = require('./src/animate/css_animation_builder');
|
||||
exports.CssAnimationBuilder = css_animation_builder_1.CssAnimationBuilder;
|
||||
var css_animation_options_1 = require('./src/animate/css_animation_options');
|
||||
exports.CssAnimationOptions = css_animation_options_1.CssAnimationOptions;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5pbWF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImFuZ3VsYXIyL2FuaW1hdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsMEJBQXdCLHlCQUF5QixDQUFDO0FBQTFDLDBDQUEwQztBQUNsRCxrQ0FBK0IsaUNBQWlDLENBQUM7QUFBekQsZ0VBQXlEO0FBQ2pFLGdDQUE2QiwrQkFBK0IsQ0FBQztBQUFyRCwwREFBcUQ7QUFDN0Qsc0NBQWtDLHFDQUFxQyxDQUFDO0FBQWhFLDBFQUFnRTtBQUN4RSxzQ0FBa0MscUNBQXFDLENBQUM7QUFBaEUsMEVBQWdFIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHtBbmltYXRpb259IGZyb20gJy4vc3JjL2FuaW1hdGUvYW5pbWF0aW9uJztcbmV4cG9ydCB7QW5pbWF0aW9uQnVpbGRlcn0gZnJvbSAnLi9zcmMvYW5pbWF0ZS9hbmltYXRpb25fYnVpbGRlcic7XG5leHBvcnQge0Jyb3dzZXJEZXRhaWxzfSBmcm9tICcuL3NyYy9hbmltYXRlL2Jyb3dzZXJfZGV0YWlscyc7XG5leHBvcnQge0Nzc0FuaW1hdGlvbkJ1aWxkZXJ9IGZyb20gJy4vc3JjL2FuaW1hdGUvY3NzX2FuaW1hdGlvbl9idWlsZGVyJztcbmV4cG9ydCB7Q3NzQW5pbWF0aW9uT3B0aW9uc30gZnJvbSAnLi9zcmMvYW5pbWF0ZS9jc3NfYW5pbWF0aW9uX29wdGlvbnMnO1xuIl19
|
|
@ -1 +0,0 @@
|
|||
export * from 'angular2/src/mock/animation_builder_mock';
|
|
@ -1,5 +0,0 @@
|
|||
'use strict';function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
__export(require('angular2/src/mock/animation_builder_mock'));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdGluZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImFuZ3VsYXIyL2FuaW1hdGUvdGVzdGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxpQkFBYywwQ0FBMEMsQ0FBQyxFQUFBIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnYW5ndWxhcjIvc3JjL21vY2svYW5pbWF0aW9uX2J1aWxkZXJfbW9jayc7XG4iXX0=
|
|
@ -1,6 +0,0 @@
|
|||
/**
|
||||
* See {@link bootstrap} for more information.
|
||||
* @deprecated
|
||||
*/
|
||||
export { bootstrap } from 'angular2/platform/browser';
|
||||
export { AngularEntrypoint } from 'angular2/src/core/angular_entrypoint';
|
|
@ -1,9 +0,0 @@
|
|||
'use strict';/**
|
||||
* See {@link bootstrap} for more information.
|
||||
* @deprecated
|
||||
*/
|
||||
var browser_1 = require('angular2/platform/browser');
|
||||
exports.bootstrap = browser_1.bootstrap;
|
||||
var angular_entrypoint_1 = require('angular2/src/core/angular_entrypoint');
|
||||
exports.AngularEntrypoint = angular_entrypoint_1.AngularEntrypoint;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9vdHN0cmFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYW5ndWxhcjIvYm9vdHN0cmFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUNILHdCQUF3QiwyQkFBMkIsQ0FBQztBQUE1Qyx3Q0FBNEM7QUFDcEQsbUNBQWdDLHNDQUFzQyxDQUFDO0FBQS9ELG1FQUErRCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogU2VlIHtAbGluayBib290c3RyYXB9IGZvciBtb3JlIGluZm9ybWF0aW9uLlxuICogQGRlcHJlY2F0ZWRcbiAqL1xuZXhwb3J0IHtib290c3RyYXB9IGZyb20gJ2FuZ3VsYXIyL3BsYXRmb3JtL2Jyb3dzZXInO1xuZXhwb3J0IHtBbmd1bGFyRW50cnlwb2ludH0gZnJvbSAnYW5ndWxhcjIvc3JjL2NvcmUvYW5ndWxhcl9lbnRyeXBvaW50JztcbiJdfQ==
|
|
@ -1,6 +0,0 @@
|
|||
/**
|
||||
* See {@link bootstrap} for more information.
|
||||
* @deprecated
|
||||
*/
|
||||
export { bootstrapStatic } from 'angular2/platform/browser_static';
|
||||
export { AngularEntrypoint } from 'angular2/src/core/angular_entrypoint';
|
|
@ -1,9 +0,0 @@
|
|||
'use strict';/**
|
||||
* See {@link bootstrap} for more information.
|
||||
* @deprecated
|
||||
*/
|
||||
var browser_static_1 = require('angular2/platform/browser_static');
|
||||
exports.bootstrapStatic = browser_static_1.bootstrapStatic;
|
||||
var angular_entrypoint_1 = require('angular2/src/core/angular_entrypoint');
|
||||
exports.AngularEntrypoint = angular_entrypoint_1.AngularEntrypoint;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9vdHN0cmFwX3N0YXRpYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImFuZ3VsYXIyL2Jvb3RzdHJhcF9zdGF0aWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7OztHQUdHO0FBQ0gsK0JBQThCLGtDQUFrQyxDQUFDO0FBQXpELDJEQUF5RDtBQUNqRSxtQ0FBZ0Msc0NBQXNDLENBQUM7QUFBL0QsbUVBQStEIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBTZWUge0BsaW5rIGJvb3RzdHJhcH0gZm9yIG1vcmUgaW5mb3JtYXRpb24uXG4gKiBAZGVwcmVjYXRlZFxuICovXG5leHBvcnQge2Jvb3RzdHJhcFN0YXRpY30gZnJvbSAnYW5ndWxhcjIvcGxhdGZvcm0vYnJvd3Nlcl9zdGF0aWMnO1xuZXhwb3J0IHtBbmd1bGFyRW50cnlwb2ludH0gZnJvbSAnYW5ndWxhcjIvc3JjL2NvcmUvYW5ndWxhcl9lbnRyeXBvaW50JztcbiJdfQ==
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -1,92 +0,0 @@
|
|||
# TL;DR;
|
||||
|
||||
* If you write ES5 use _one_ of the `UMD` bundles.
|
||||
* If you experiment with Angular2 using online prototyping tools like [plnkr](http://plnkr.co/) or similar use `System.register` bundles with SystemJS loader.
|
||||
* If you use build tools like Browserify or WebPack - bundle Angular2 as part of your build.
|
||||
* For all the above cases you must use `angular2-polyfills.js` in a `script` tag to easily include polyfills and external dependencies.
|
||||
|
||||
# Modules, barrels and bundles
|
||||
|
||||
Angular2 source code is authored using the ES2015 standardized module format where one module corresponds to exactly one file. Multiple modules (files) can be logically grouped into so-called "barrels".
|
||||
A bundle is a file that contains all the code for one or more barrels.
|
||||
|
||||
Most bundles come in several flavors:
|
||||
* regular and minified (got `.min` in their name);
|
||||
* regular and "development" (have `.dev` in their name) - "development" bundles contain in-line source maps and don't have minified flavor (minification removes in-lined source maps).
|
||||
|
||||
# Bundles, their content and usage scenarios
|
||||
|
||||
Angular 2 distributes several types of bundles targeted at specific usages:
|
||||
* users writing ES5 code without any transpilation steps
|
||||
* users experimenting with Angular 2 and TypeScript/ES2015 using online tools like plunker, jsbin or similar
|
||||
|
||||
Since each identified scenario has slightly different requirements and constraints there are specific bundles for each use-case.
|
||||
|
||||
## ES5 and ngUpgrade users
|
||||
|
||||
ES5 users and AngularJS 1.x users interested in the `ngUpgrade` path can take advantage of the bundles in the [UMD format](https://github.com/umdjs/umd).
|
||||
Those are coarse-grained bundles that combine many barrels in one final file.
|
||||
|
||||
filename | list of barrels | dev/prod | minified?
|
||||
------------|-------------------|----------|-------------|--------------|-------------
|
||||
`angular2-all.umd.js` | `angular2/core`, `angular2/common`, `angular2/compiler`, `angular2/platform/browser`, `angular2/platform/common_dom`, `angular2/http`, `angular2/router`, `angular2/instrumentation`, `angular2/upgrade`| prod | no
|
||||
`angular2-all.umd.min.js` | `angular2/core`, `angular2/common`, `angular2/compiler`, `angular2/platform/browser`, `angular2/platform/common_dom`, `angular2/http`, `angular2/router`, `angular2/instrumentation`, `angular2/upgrade` | prod | yes
|
||||
`angular2-all.umd.dev.js` | `angular2/core`, `angular2/common`, `angular2/compiler`, `angular2/platform/browser`, `angular2/platform/common_dom`, `angular2/http`, `angular2/router`, `angular2/instrumentation`, `angular2/upgrade` | dev | no
|
||||
`angular2-all-testing.umd.dev.js` | `angular2/core`, `angular2/common`, `angular2/compiler`, `angular2/platform/browser`, `angular2/platform/common_dom`, `angular2/http`, `angular2/router`, `angular2/instrumentation`, `angular2/upgrade`, `angular2/testing`, `angular2/http/testing`, `angular2/router/testing`, `angular2/platform/testing/browser` | dev | no
|
||||
|
||||
**Warning**: bundles in the `UMD` format are _not_ "additive". A single application should use only one bundle from the above list.
|
||||
|
||||
## SystemJS loader users
|
||||
|
||||
[SystemJS loader](https://github.com/systemjs/systemjs) with on-the-fly (in a browser) transpilations support is very useful for quick experiments using tools like plunker, jsbin or similar.
|
||||
For this scenario Angular 2 is distributed with bundles in the [System.register format](https://github.com/ModuleLoader/es6-module-loader/wiki/System.register-Explained):
|
||||
|
||||
filename | list of barrels | dev/prod | minified?
|
||||
------------|-------------------|----------|-------------|--------------|-------------
|
||||
`angular2.js` | `angular2/core`, `angular2/common`, `angular2/compiler`, `angular2/platform/browser`, `angular2/platform/common_dom`, `angular2/instrumentation`| prod | no
|
||||
`angular2.min.js` | `angular2/core`, `angular2/common`, `angular2/compiler`, `angular2/platform/browser`, `angular2/platform/common_dom`, `angular2/instrumentation`| prod | yes
|
||||
`angular2.dev.js` | `angular2/core`, `angular2/common`, `angular2/compiler`, `angular2/platform/browser`, `angular2/platform/common_dom`, `angular2/instrumentation`| dev | no
|
||||
`http.js` | `angular2/http` | prod | no
|
||||
`http.min.js` | `angular2/http` | prod | yes
|
||||
`http.dev.js` | `angular2/http` | dev | no
|
||||
`router.js` | `angular2/router` | prod | no
|
||||
`router.min.js` | `angular2/router` | prod | yes
|
||||
`router.dev.js` | `angular2/router` | dev | no
|
||||
`upgrade.js` | `angular2/upgrade` | prod | no
|
||||
`upgrade.min.js` | `angular2/upgrade` | prod | yes
|
||||
`upgrade.dev.js` | `angular2/upgrade` | dev | no
|
||||
`testing.dev.js` | `angular2/testing`, `angular2/http/testing`, `angular2/router/testing`, `angular2/platform/testing/browser` | dev | no
|
||||
|
||||
**Note**: bundles in the `System.register` format are "additive" - it is quite common to include several bundles in one application.
|
||||
For example people using Angular 2 with `http` and `router` would include: `angular2.js`, `http.js` and `router.js`.
|
||||
|
||||
## Browserify / JSPM / Rollup / WebPack users
|
||||
|
||||
Angular 2 doesn't provide any bundles for use with packaging tools Browserify or WebPack. Those tools are sophisticated enough to build optimal bundles for production use from individual Angular 2 files distributed in the npm package.
|
||||
An example of an Angular 2 project built with WebPack can be found in the [angular2-seed](https://github.com/angular/angular2-seed) repository.
|
||||
|
||||
|
||||
# Polyfills and external dependencies
|
||||
|
||||
## Required Polyfills
|
||||
|
||||
Polyfills are required for Angular 2 to function properly (the exact list depends on the browser used) and external dependencies ([zone.js](https://github.com/angular/zone.js)).
|
||||
To ease setup of Angular 2 applications there is one file - `angular2-polyfills.js` - that combines:
|
||||
* a pollyfill mandatory for all browsers: [reflect-metadata](https://www.npmjs.com/package/reflect-metadata)
|
||||
* [zone.js](https://github.com/angular/zone.js)
|
||||
|
||||
**Note**: `angular2-polyfills.js` contains code that should be loaded into the browser as the very first code of the web application even before the module loader. The preferred solution is to load the mentioned file in a `script` tag as early as possible.
|
||||
|
||||
|
||||
## RxJS
|
||||
|
||||
[RxJS](https://github.com/ReactiveX/RxJS) is a required dependency of Angular 2.
|
||||
|
||||
You should include RxJS in your project by declaring a dependency on the [`rxjs` npm package](https://www.npmjs.com/package/rxjs).
|
||||
|
||||
Depending on if you are using Angular bundles or not you can either use RxJS bundles from `node_modules/rxjs/bundles/` or configure your bundler to pull in the individual files from the npm package.
|
||||
|
||||
|
||||
## ES6 shims (optional)
|
||||
|
||||
Users of pre-ES6 browsers might need to add an ES6 shim (e.g. [es6-shim](https://github.com/paulmillr/es6-shim))
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -1,668 +0,0 @@
|
|||
// Type definitions for es6-shim v0.31.2
|
||||
// Project: https://github.com/paulmillr/es6-shim
|
||||
// Definitions by: Ron Buckton <http://github.com/rbuckton>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare type PropertyKey = string | number | symbol;
|
||||
|
||||
interface IteratorResult<T> {
|
||||
done: boolean;
|
||||
value?: T;
|
||||
}
|
||||
|
||||
interface IterableShim<T> {
|
||||
/**
|
||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
||||
*/
|
||||
"_es6-shim iterator_"(): Iterator<T>;
|
||||
}
|
||||
|
||||
interface Iterator<T> {
|
||||
next(value?: any): IteratorResult<T>;
|
||||
return?(value?: any): IteratorResult<T>;
|
||||
throw?(e?: any): IteratorResult<T>;
|
||||
}
|
||||
|
||||
interface IterableIteratorShim<T> extends IterableShim<T>, Iterator<T> {
|
||||
/**
|
||||
* Shim for an ES6 iterable iterator. Not intended for direct use by user code.
|
||||
*/
|
||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
||||
}
|
||||
|
||||
interface StringConstructor {
|
||||
/**
|
||||
* Return the String value whose elements are, in order, the elements in the List elements.
|
||||
* If length is 0, the empty string is returned.
|
||||
*/
|
||||
fromCodePoint(...codePoints: number[]): string;
|
||||
|
||||
/**
|
||||
* String.raw is intended for use as a tag function of a Tagged Template String. When called
|
||||
* as such the first argument will be a well formed template call site object and the rest
|
||||
* parameter will contain the substitution values.
|
||||
* @param template A well-formed template string call site representation.
|
||||
* @param substitutions A set of substitution values.
|
||||
*/
|
||||
raw(template: TemplateStringsArray, ...substitutions: any[]): string;
|
||||
}
|
||||
|
||||
interface String {
|
||||
/**
|
||||
* Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
|
||||
* value of the UTF-16 encoded code point starting at the string element at position pos in
|
||||
* the String resulting from converting this object to a String.
|
||||
* If there is no element at that position, the result is undefined.
|
||||
* If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
|
||||
*/
|
||||
codePointAt(pos: number): number;
|
||||
|
||||
/**
|
||||
* Returns true if searchString appears as a substring of the result of converting this
|
||||
* object to a String, at one or more positions that are
|
||||
* greater than or equal to position; otherwise, returns false.
|
||||
* @param searchString search string
|
||||
* @param position If position is undefined, 0 is assumed, so as to search all of the String.
|
||||
*/
|
||||
includes(searchString: string, position?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
||||
* same as the corresponding elements of this object (converted to a String) starting at
|
||||
* endPosition – length(this). Otherwise returns false.
|
||||
*/
|
||||
endsWith(searchString: string, endPosition?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns a String value that is made from count copies appended together. If count is 0,
|
||||
* T is the empty String is returned.
|
||||
* @param count number of copies to append
|
||||
*/
|
||||
repeat(count: number): string;
|
||||
|
||||
/**
|
||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
||||
* same as the corresponding elements of this object (converted to a String) starting at
|
||||
* position. Otherwise returns false.
|
||||
*/
|
||||
startsWith(searchString: string, position?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns an <a> HTML anchor element and sets the name attribute to the text value
|
||||
* @param name
|
||||
*/
|
||||
anchor(name: string): string;
|
||||
|
||||
/** Returns a <big> HTML element */
|
||||
big(): string;
|
||||
|
||||
/** Returns a <blink> HTML element */
|
||||
blink(): string;
|
||||
|
||||
/** Returns a <b> HTML element */
|
||||
bold(): string;
|
||||
|
||||
/** Returns a <tt> HTML element */
|
||||
fixed(): string
|
||||
|
||||
/** Returns a <font> HTML element and sets the color attribute value */
|
||||
fontcolor(color: string): string
|
||||
|
||||
/** Returns a <font> HTML element and sets the size attribute value */
|
||||
fontsize(size: number): string;
|
||||
|
||||
/** Returns a <font> HTML element and sets the size attribute value */
|
||||
fontsize(size: string): string;
|
||||
|
||||
/** Returns an <i> HTML element */
|
||||
italics(): string;
|
||||
|
||||
/** Returns an <a> HTML element and sets the href attribute value */
|
||||
link(url: string): string;
|
||||
|
||||
/** Returns a <small> HTML element */
|
||||
small(): string;
|
||||
|
||||
/** Returns a <strike> HTML element */
|
||||
strike(): string;
|
||||
|
||||
/** Returns a <sub> HTML element */
|
||||
sub(): string;
|
||||
|
||||
/** Returns a <sup> HTML element */
|
||||
sup(): string;
|
||||
|
||||
/**
|
||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
||||
*/
|
||||
"_es6-shim iterator_"(): IterableIteratorShim<string>;
|
||||
}
|
||||
|
||||
interface ArrayConstructor {
|
||||
/**
|
||||
* Creates an array from an array-like object.
|
||||
* @param arrayLike An array-like object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
||||
|
||||
/**
|
||||
* Creates an array from an iterable object.
|
||||
* @param iterable An iterable object to convert to an array.
|
||||
* @param mapfn A mapping function to call on every element of the array.
|
||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
||||
*/
|
||||
from<T, U>(iterable: IterableShim<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
||||
|
||||
/**
|
||||
* Creates an array from an array-like object.
|
||||
* @param arrayLike An array-like object to convert to an array.
|
||||
*/
|
||||
from<T>(arrayLike: ArrayLike<T>): Array<T>;
|
||||
|
||||
/**
|
||||
* Creates an array from an iterable object.
|
||||
* @param iterable An iterable object to convert to an array.
|
||||
*/
|
||||
from<T>(iterable: IterableShim<T>): Array<T>;
|
||||
|
||||
/**
|
||||
* Returns a new array from a set of elements.
|
||||
* @param items A set of elements to include in the new array object.
|
||||
*/
|
||||
of<T>(...items: T[]): Array<T>;
|
||||
}
|
||||
|
||||
interface Array<T> {
|
||||
/**
|
||||
* Returns the value of the first element in the array where predicate is true, and undefined
|
||||
* otherwise.
|
||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
||||
* immediately returns that element value. Otherwise, find returns undefined.
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
|
||||
|
||||
/**
|
||||
* Returns the index of the first element in the array where predicate is true, and undefined
|
||||
* otherwise.
|
||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
||||
* immediately returns that element value. Otherwise, find returns undefined.
|
||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
||||
* predicate. If it is not provided, undefined is used instead.
|
||||
*/
|
||||
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
|
||||
|
||||
/**
|
||||
* Returns the this object after filling the section identified by start and end with value
|
||||
* @param value value to fill array section with
|
||||
* @param start index to start filling the array at. If start is negative, it is treated as
|
||||
* length+start where length is the length of the array.
|
||||
* @param end index to stop filling the array at. If end is negative, it is treated as
|
||||
* length+end.
|
||||
*/
|
||||
fill(value: T, start?: number, end?: number): T[];
|
||||
|
||||
/**
|
||||
* Returns the this object after copying a section of the array identified by start and end
|
||||
* to the same array starting at position target
|
||||
* @param target If target is negative, it is treated as length+target where length is the
|
||||
* length of the array.
|
||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
||||
* is treated as length+end.
|
||||
* @param end If not specified, length of the this object is used as its default value.
|
||||
*/
|
||||
copyWithin(target: number, start: number, end?: number): T[];
|
||||
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIteratorShim<[number, T]>;
|
||||
|
||||
/**
|
||||
* Returns an list of keys in the array
|
||||
*/
|
||||
keys(): IterableIteratorShim<number>;
|
||||
|
||||
/**
|
||||
* Returns an list of values in the array
|
||||
*/
|
||||
values(): IterableIteratorShim<T>;
|
||||
|
||||
/**
|
||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
||||
*/
|
||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
||||
}
|
||||
|
||||
interface NumberConstructor {
|
||||
/**
|
||||
* The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
|
||||
* that is representable as a Number value, which is approximately:
|
||||
* 2.2204460492503130808472633361816 x 10−16.
|
||||
*/
|
||||
EPSILON: number;
|
||||
|
||||
/**
|
||||
* Returns true if passed value is finite.
|
||||
* Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
|
||||
* number. Only finite values of the type number, result in true.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isFinite(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the value passed is an integer, false otherwise.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isInteger(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
|
||||
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
|
||||
* to a number. Only values of the type number, that are also NaN, result in true.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isNaN(number: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the value passed is a safe integer.
|
||||
* @param number A numeric value.
|
||||
*/
|
||||
isSafeInteger(number: number): boolean;
|
||||
|
||||
/**
|
||||
* The value of the largest integer n such that n and n + 1 are both exactly representable as
|
||||
* a Number value.
|
||||
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
|
||||
*/
|
||||
MAX_SAFE_INTEGER: number;
|
||||
|
||||
/**
|
||||
* The value of the smallest integer n such that n and n − 1 are both exactly representable as
|
||||
* a Number value.
|
||||
* The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
|
||||
*/
|
||||
MIN_SAFE_INTEGER: number;
|
||||
|
||||
/**
|
||||
* Converts a string to a floating-point number.
|
||||
* @param string A string that contains a floating-point number.
|
||||
*/
|
||||
parseFloat(string: string): number;
|
||||
|
||||
/**
|
||||
* Converts A string to an integer.
|
||||
* @param s A string to convert into a number.
|
||||
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
|
||||
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
|
||||
* All other strings are considered decimal.
|
||||
*/
|
||||
parseInt(string: string, radix?: number): number;
|
||||
}
|
||||
|
||||
interface ObjectConstructor {
|
||||
/**
|
||||
* Copy the values of all of the enumerable own properties from one or more source objects to a
|
||||
* target object. Returns the target object.
|
||||
* @param target The target object to copy to.
|
||||
* @param sources One or more source objects to copy properties from.
|
||||
*/
|
||||
assign(target: any, ...sources: any[]): any;
|
||||
|
||||
/**
|
||||
* Returns true if the values are the same value, false otherwise.
|
||||
* @param value1 The first value.
|
||||
* @param value2 The second value.
|
||||
*/
|
||||
is(value1: any, value2: any): boolean;
|
||||
|
||||
/**
|
||||
* Sets the prototype of a specified object o to object proto or null. Returns the object o.
|
||||
* @param o The object to change its prototype.
|
||||
* @param proto The value of the new prototype or null.
|
||||
* @remarks Requires `__proto__` support.
|
||||
*/
|
||||
setPrototypeOf(o: any, proto: any): any;
|
||||
}
|
||||
|
||||
interface RegExp {
|
||||
/**
|
||||
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
|
||||
* The characters in this string are sequenced and concatenated in the following order:
|
||||
*
|
||||
* - "g" for global
|
||||
* - "i" for ignoreCase
|
||||
* - "m" for multiline
|
||||
* - "u" for unicode
|
||||
* - "y" for sticky
|
||||
*
|
||||
* If no flags are set, the value is the empty string.
|
||||
*/
|
||||
flags: string;
|
||||
}
|
||||
|
||||
interface Math {
|
||||
/**
|
||||
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
clz32(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the result of 32-bit multiplication of two numbers.
|
||||
* @param x First number
|
||||
* @param y Second number
|
||||
*/
|
||||
imul(x: number, y: number): number;
|
||||
|
||||
/**
|
||||
* Returns the sign of the x, indicating whether x is positive, negative or zero.
|
||||
* @param x The numeric expression to test
|
||||
*/
|
||||
sign(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the base 10 logarithm of a number.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
log10(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the base 2 logarithm of a number.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
log2(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the natural logarithm of 1 + x.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
log1p(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of
|
||||
* the natural logarithms).
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
expm1(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic cosine of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
cosh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic sine of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
sinh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the hyperbolic tangent of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
tanh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the inverse hyperbolic cosine of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
acosh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the inverse hyperbolic sine of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
asinh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the inverse hyperbolic tangent of a number.
|
||||
* @param x A numeric expression that contains an angle measured in radians.
|
||||
*/
|
||||
atanh(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the square root of the sum of squares of its arguments.
|
||||
* @param values Values to compute the square root for.
|
||||
* If no arguments are passed, the result is +0.
|
||||
* If there is only one argument, the result is the absolute value.
|
||||
* If any argument is +Infinity or -Infinity, the result is +Infinity.
|
||||
* If any argument is NaN, the result is NaN.
|
||||
* If all arguments are either +0 or −0, the result is +0.
|
||||
*/
|
||||
hypot(...values: number[]): number;
|
||||
|
||||
/**
|
||||
* Returns the integral part of the a numeric expression, x, removing any fractional digits.
|
||||
* If x is already an integer, the result is x.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
trunc(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns the nearest single precision float representation of a number.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
fround(x: number): number;
|
||||
|
||||
/**
|
||||
* Returns an implementation-dependent approximation to the cube root of number.
|
||||
* @param x A numeric expression.
|
||||
*/
|
||||
cbrt(x: number): number;
|
||||
}
|
||||
|
||||
interface PromiseLike<T> {
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
* @param onrejected The callback to execute when the Promise is rejected.
|
||||
* @returns A Promise for the completion of which ever callback is executed.
|
||||
*/
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the completion of an asynchronous operation
|
||||
*/
|
||||
interface Promise<T> {
|
||||
/**
|
||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
||||
* @param onrejected The callback to execute when the Promise is rejected.
|
||||
* @returns A Promise for the completion of which ever callback is executed.
|
||||
*/
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
|
||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
|
||||
|
||||
/**
|
||||
* Attaches a callback for only the rejection of the Promise.
|
||||
* @param onrejected The callback to execute when the Promise is rejected.
|
||||
* @returns A Promise for the completion of the callback.
|
||||
*/
|
||||
catch(onrejected?: (reason: any) => T | PromiseLike<T>): Promise<T>;
|
||||
catch(onrejected?: (reason: any) => void): Promise<T>;
|
||||
}
|
||||
|
||||
interface PromiseConstructor {
|
||||
/**
|
||||
* A reference to the prototype.
|
||||
*/
|
||||
prototype: Promise<any>;
|
||||
|
||||
/**
|
||||
* Creates a new Promise.
|
||||
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
|
||||
* a resolve callback used resolve the promise with a value or the result of another promise,
|
||||
* and a reject callback used to reject the promise with a provided reason or error.
|
||||
*/
|
||||
new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
|
||||
|
||||
/**
|
||||
* Creates a Promise that is resolved with an array of results when all of the provided Promises
|
||||
* resolve, or rejected when any Promise is rejected.
|
||||
* @param values An array of Promises.
|
||||
* @returns A new Promise.
|
||||
*/
|
||||
all<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T[]>;
|
||||
|
||||
/**
|
||||
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
|
||||
* or rejected.
|
||||
* @param values An array of Promises.
|
||||
* @returns A new Promise.
|
||||
*/
|
||||
race<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T>;
|
||||
|
||||
/**
|
||||
* Creates a new rejected promise for the provided reason.
|
||||
* @param reason The reason the promise was rejected.
|
||||
* @returns A new rejected Promise.
|
||||
*/
|
||||
reject(reason: any): Promise<void>;
|
||||
|
||||
/**
|
||||
* Creates a new rejected promise for the provided reason.
|
||||
* @param reason The reason the promise was rejected.
|
||||
* @returns A new rejected Promise.
|
||||
*/
|
||||
reject<T>(reason: any): Promise<T>;
|
||||
|
||||
/**
|
||||
* Creates a new resolved promise for the provided value.
|
||||
* @param value A promise.
|
||||
* @returns A promise whose internal state matches the provided promise.
|
||||
*/
|
||||
resolve<T>(value: T | PromiseLike<T>): Promise<T>;
|
||||
|
||||
/**
|
||||
* Creates a new resolved promise .
|
||||
* @returns A resolved promise.
|
||||
*/
|
||||
resolve(): Promise<void>;
|
||||
}
|
||||
|
||||
declare var Promise: PromiseConstructor;
|
||||
|
||||
interface Map<K, V> {
|
||||
clear(): void;
|
||||
delete(key: K): boolean;
|
||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
||||
get(key: K): V;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): Map<K, V>;
|
||||
size: number;
|
||||
entries(): IterableIteratorShim<[K, V]>;
|
||||
keys(): IterableIteratorShim<K>;
|
||||
values(): IterableIteratorShim<V>;
|
||||
}
|
||||
|
||||
interface MapConstructor {
|
||||
new <K, V>(): Map<K, V>;
|
||||
new <K, V>(iterable: IterableShim<[K, V]>): Map<K, V>;
|
||||
prototype: Map<any, any>;
|
||||
}
|
||||
|
||||
declare var Map: MapConstructor;
|
||||
|
||||
interface Set<T> {
|
||||
add(value: T): Set<T>;
|
||||
clear(): void;
|
||||
delete(value: T): boolean;
|
||||
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
|
||||
has(value: T): boolean;
|
||||
size: number;
|
||||
entries(): IterableIteratorShim<[T, T]>;
|
||||
keys(): IterableIteratorShim<T>;
|
||||
values(): IterableIteratorShim<T>;
|
||||
}
|
||||
|
||||
interface SetConstructor {
|
||||
new <T>(): Set<T>;
|
||||
new <T>(iterable: IterableShim<T>): Set<T>;
|
||||
prototype: Set<any>;
|
||||
}
|
||||
|
||||
declare var Set: SetConstructor;
|
||||
|
||||
interface WeakMap<K, V> {
|
||||
delete(key: K): boolean;
|
||||
get(key: K): V;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): WeakMap<K, V>;
|
||||
}
|
||||
|
||||
interface WeakMapConstructor {
|
||||
new <K, V>(): WeakMap<K, V>;
|
||||
new <K, V>(iterable: IterableShim<[K, V]>): WeakMap<K, V>;
|
||||
prototype: WeakMap<any, any>;
|
||||
}
|
||||
|
||||
declare var WeakMap: WeakMapConstructor;
|
||||
|
||||
interface WeakSet<T> {
|
||||
add(value: T): WeakSet<T>;
|
||||
delete(value: T): boolean;
|
||||
has(value: T): boolean;
|
||||
}
|
||||
|
||||
interface WeakSetConstructor {
|
||||
new <T>(): WeakSet<T>;
|
||||
new <T>(iterable: IterableShim<T>): WeakSet<T>;
|
||||
prototype: WeakSet<any>;
|
||||
}
|
||||
|
||||
declare var WeakSet: WeakSetConstructor;
|
||||
|
||||
declare module Reflect {
|
||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
||||
function enumerate(target: any): IterableIteratorShim<any>;
|
||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
||||
function getPrototypeOf(target: any): any;
|
||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
||||
function isExtensible(target: any): boolean;
|
||||
function ownKeys(target: any): Array<PropertyKey>;
|
||||
function preventExtensions(target: any): boolean;
|
||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
||||
function setPrototypeOf(target: any, proto: any): boolean;
|
||||
}
|
||||
|
||||
declare module "es6-shim" {
|
||||
var String: StringConstructor;
|
||||
var Array: ArrayConstructor;
|
||||
var Number: NumberConstructor;
|
||||
var Math: Math;
|
||||
var Object: ObjectConstructor;
|
||||
var Map: MapConstructor;
|
||||
var Set: SetConstructor;
|
||||
var WeakMap: WeakMapConstructor;
|
||||
var WeakSet: WeakSetConstructor;
|
||||
var Promise: PromiseConstructor;
|
||||
module Reflect {
|
||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
||||
function enumerate(target: any): Iterator<any>;
|
||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
||||
function getPrototypeOf(target: any): any;
|
||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
||||
function isExtensible(target: any): boolean;
|
||||
function ownKeys(target: any): Array<PropertyKey>;
|
||||
function preventExtensions(target: any): boolean;
|
||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
||||
function setPrototypeOf(target: any, proto: any): boolean;
|
||||
}
|
||||
}
|
|
@ -1,534 +0,0 @@
|
|||
// Type definitions for Jasmine 2.2
|
||||
// Project: http://jasmine.github.io/
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Theodore Brown <https://github.com/theodorejb>, David Pärsson <https://github.com/davidparsson/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
// For ddescribe / iit use : https://github.com/borisyankov/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts
|
||||
|
||||
declare function describe(description: string, specDefinitions: () => void): void;
|
||||
declare function fdescribe(description: string, specDefinitions: () => void): void;
|
||||
declare function xdescribe(description: string, specDefinitions: () => void): void;
|
||||
|
||||
declare function it(expectation: string, assertion?: () => void, timeout?: number): void;
|
||||
declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
|
||||
declare function fit(expectation: string, assertion?: () => void, timeout?: number): void;
|
||||
declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
|
||||
declare function xit(expectation: string, assertion?: () => void, timeout?: number): void;
|
||||
declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
|
||||
|
||||
/** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */
|
||||
declare function pending(reason?: string): void;
|
||||
|
||||
declare function beforeEach(action: () => void, timeout?: number): void;
|
||||
declare function beforeEach(action: (done: () => void) => void, timeout?: number): void;
|
||||
declare function afterEach(action: () => void, timeout?: number): void;
|
||||
declare function afterEach(action: (done: () => void) => void, timeout?: number): void;
|
||||
|
||||
declare function beforeAll(action: () => void, timeout?: number): void;
|
||||
declare function beforeAll(action: (done: () => void) => void, timeout?: number): void;
|
||||
declare function afterAll(action: () => void, timeout?: number): void;
|
||||
declare function afterAll(action: (done: () => void) => void, timeout?: number): void;
|
||||
|
||||
declare function expect(spy: Function): jasmine.Matchers;
|
||||
declare function expect(actual: any): jasmine.Matchers;
|
||||
|
||||
declare function fail(e?: any): void;
|
||||
|
||||
declare function spyOn(object: any, method: string): jasmine.Spy;
|
||||
|
||||
declare function runs(asyncMethod: Function): void;
|
||||
declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void;
|
||||
declare function waits(timeout?: number): void;
|
||||
|
||||
declare module jasmine {
|
||||
|
||||
var clock: () => Clock;
|
||||
|
||||
function any(aclass: any): Any;
|
||||
function anything(): Any;
|
||||
function arrayContaining(sample: any[]): ArrayContaining;
|
||||
function objectContaining(sample: any): ObjectContaining;
|
||||
function createSpy(name: string, originalFn?: Function): Spy;
|
||||
function createSpyObj(baseName: string, methodNames: any[]): any;
|
||||
function createSpyObj<T>(baseName: string, methodNames: any[]): T;
|
||||
function pp(value: any): string;
|
||||
function getEnv(): Env;
|
||||
function addCustomEqualityTester(equalityTester: CustomEqualityTester): void;
|
||||
function addMatchers(matchers: CustomMatcherFactories): void;
|
||||
function stringMatching(str: string): Any;
|
||||
function stringMatching(str: RegExp): Any;
|
||||
|
||||
interface Any {
|
||||
|
||||
new (expectedClass: any): any;
|
||||
|
||||
jasmineMatches(other: any): boolean;
|
||||
jasmineToString(): string;
|
||||
}
|
||||
|
||||
// taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains()
|
||||
interface ArrayLike<T> {
|
||||
length: number;
|
||||
[n: number]: T;
|
||||
}
|
||||
|
||||
interface ArrayContaining {
|
||||
new (sample: any[]): any;
|
||||
|
||||
asymmetricMatch(other: any): boolean;
|
||||
jasmineToString(): string;
|
||||
}
|
||||
|
||||
interface ObjectContaining {
|
||||
new (sample: any): any;
|
||||
|
||||
jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean;
|
||||
jasmineToString(): string;
|
||||
}
|
||||
|
||||
interface Block {
|
||||
|
||||
new (env: Env, func: SpecFunction, spec: Spec): any;
|
||||
|
||||
execute(onComplete: () => void): void;
|
||||
}
|
||||
|
||||
interface WaitsBlock extends Block {
|
||||
new (env: Env, timeout: number, spec: Spec): any;
|
||||
}
|
||||
|
||||
interface WaitsForBlock extends Block {
|
||||
new (env: Env, timeout: number, latchFunction: SpecFunction, message: string, spec: Spec): any;
|
||||
}
|
||||
|
||||
interface Clock {
|
||||
install(): void;
|
||||
uninstall(): void;
|
||||
/** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */
|
||||
tick(ms: number): void;
|
||||
mockDate(date?: Date): void;
|
||||
}
|
||||
|
||||
interface CustomEqualityTester {
|
||||
(first: any, second: any): boolean;
|
||||
}
|
||||
|
||||
interface CustomMatcher {
|
||||
compare<T>(actual: T, expected: T): CustomMatcherResult;
|
||||
compare(actual: any, expected: any): CustomMatcherResult;
|
||||
}
|
||||
|
||||
interface CustomMatcherFactory {
|
||||
(util: MatchersUtil, customEqualityTesters: Array<CustomEqualityTester>): CustomMatcher;
|
||||
}
|
||||
|
||||
interface CustomMatcherFactories {
|
||||
[index: string]: CustomMatcherFactory;
|
||||
}
|
||||
|
||||
interface CustomMatcherResult {
|
||||
pass: boolean;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
interface MatchersUtil {
|
||||
equals(a: any, b: any, customTesters?: Array<CustomEqualityTester>): boolean;
|
||||
contains<T>(haystack: ArrayLike<T> | string, needle: any, customTesters?: Array<CustomEqualityTester>): boolean;
|
||||
buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array<any>): string;
|
||||
}
|
||||
|
||||
interface Env {
|
||||
setTimeout: any;
|
||||
clearTimeout: void;
|
||||
setInterval: any;
|
||||
clearInterval: void;
|
||||
updateInterval: number;
|
||||
|
||||
currentSpec: Spec;
|
||||
|
||||
matchersClass: Matchers;
|
||||
|
||||
version(): any;
|
||||
versionString(): string;
|
||||
nextSpecId(): number;
|
||||
addReporter(reporter: Reporter): void;
|
||||
execute(): void;
|
||||
describe(description: string, specDefinitions: () => void): Suite;
|
||||
// ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these
|
||||
beforeEach(beforeEachFunction: () => void): void;
|
||||
beforeAll(beforeAllFunction: () => void): void;
|
||||
currentRunner(): Runner;
|
||||
afterEach(afterEachFunction: () => void): void;
|
||||
afterAll(afterAllFunction: () => void): void;
|
||||
xdescribe(desc: string, specDefinitions: () => void): XSuite;
|
||||
it(description: string, func: () => void): Spec;
|
||||
// iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these
|
||||
xit(desc: string, func: () => void): XSpec;
|
||||
compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean;
|
||||
compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean;
|
||||
equals_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean;
|
||||
contains_(haystack: any, needle: any): boolean;
|
||||
addCustomEqualityTester(equalityTester: CustomEqualityTester): void;
|
||||
addMatchers(matchers: CustomMatcherFactories): void;
|
||||
specFilter(spec: Spec): boolean;
|
||||
}
|
||||
|
||||
interface FakeTimer {
|
||||
|
||||
new (): any;
|
||||
|
||||
reset(): void;
|
||||
tick(millis: number): void;
|
||||
runFunctionsWithinRange(oldMillis: number, nowMillis: number): void;
|
||||
scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void;
|
||||
}
|
||||
|
||||
interface HtmlReporter {
|
||||
new (): any;
|
||||
}
|
||||
|
||||
interface HtmlSpecFilter {
|
||||
new (): any;
|
||||
}
|
||||
|
||||
interface Result {
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface NestedResults extends Result {
|
||||
description: string;
|
||||
|
||||
totalCount: number;
|
||||
passedCount: number;
|
||||
failedCount: number;
|
||||
|
||||
skipped: boolean;
|
||||
|
||||
rollupCounts(result: NestedResults): void;
|
||||
log(values: any): void;
|
||||
getItems(): Result[];
|
||||
addResult(result: Result): void;
|
||||
passed(): boolean;
|
||||
}
|
||||
|
||||
interface MessageResult extends Result {
|
||||
values: any;
|
||||
trace: Trace;
|
||||
}
|
||||
|
||||
interface ExpectationResult extends Result {
|
||||
matcherName: string;
|
||||
passed(): boolean;
|
||||
expected: any;
|
||||
actual: any;
|
||||
message: string;
|
||||
trace: Trace;
|
||||
}
|
||||
|
||||
interface Trace {
|
||||
name: string;
|
||||
message: string;
|
||||
stack: any;
|
||||
}
|
||||
|
||||
interface PrettyPrinter {
|
||||
|
||||
new (): any;
|
||||
|
||||
format(value: any): void;
|
||||
iterateObject(obj: any, fn: (property: string, isGetter: boolean) => void): void;
|
||||
emitScalar(value: any): void;
|
||||
emitString(value: string): void;
|
||||
emitArray(array: any[]): void;
|
||||
emitObject(obj: any): void;
|
||||
append(value: any): void;
|
||||
}
|
||||
|
||||
interface StringPrettyPrinter extends PrettyPrinter {
|
||||
}
|
||||
|
||||
interface Queue {
|
||||
|
||||
new (env: any): any;
|
||||
|
||||
env: Env;
|
||||
ensured: boolean[];
|
||||
blocks: Block[];
|
||||
running: boolean;
|
||||
index: number;
|
||||
offset: number;
|
||||
abort: boolean;
|
||||
|
||||
addBefore(block: Block, ensure?: boolean): void;
|
||||
add(block: any, ensure?: boolean): void;
|
||||
insertNext(block: any, ensure?: boolean): void;
|
||||
start(onComplete?: () => void): void;
|
||||
isRunning(): boolean;
|
||||
next_(): void;
|
||||
results(): NestedResults;
|
||||
}
|
||||
|
||||
interface Matchers {
|
||||
|
||||
new (env: Env, actual: any, spec: Env, isNot?: boolean): any;
|
||||
|
||||
env: Env;
|
||||
actual: any;
|
||||
spec: Env;
|
||||
isNot?: boolean;
|
||||
message(): any;
|
||||
|
||||
(expected: any): boolean;
|
||||
toBe(expected: any, expectationFailOutput?: any): boolean;
|
||||
toEqual(expected: any, expectationFailOutput?: any): boolean;
|
||||
toMatch(expected: any, expectationFailOutput?: any): boolean;
|
||||
toBeDefined(expectationFailOutput?: any): boolean;
|
||||
toBeUndefined(expectationFailOutput?: any): boolean;
|
||||
toBeNull(expectationFailOutput?: any): boolean;
|
||||
toBeNaN(): boolean;
|
||||
toBeTruthy(expectationFailOutput?: any): boolean;
|
||||
toBeFalsy(expectationFailOutput?: any): boolean;
|
||||
toHaveBeenCalled(): boolean;
|
||||
toHaveBeenCalledWith(...params: any[]): boolean;
|
||||
toContain(expected: any, expectationFailOutput?: any): boolean;
|
||||
toBeLessThan(expected: any, expectationFailOutput?: any): boolean;
|
||||
toBeGreaterThan(expected: any, expectationFailOutput?: any): boolean;
|
||||
toBeCloseTo(expected: any, precision: any, expectationFailOutput?: any): boolean;
|
||||
toContainHtml(expected: string): boolean;
|
||||
toContainText(expected: string): boolean;
|
||||
toThrow(expected?: any): boolean;
|
||||
toThrowError(expected?: any, message?: string): boolean;
|
||||
not: Matchers;
|
||||
|
||||
Any: Any;
|
||||
}
|
||||
|
||||
interface Reporter {
|
||||
reportRunnerStarting(runner: Runner): void;
|
||||
reportRunnerResults(runner: Runner): void;
|
||||
reportSuiteResults(suite: Suite): void;
|
||||
reportSpecStarting(spec: Spec): void;
|
||||
reportSpecResults(spec: Spec): void;
|
||||
log(str: string): void;
|
||||
}
|
||||
|
||||
interface MultiReporter extends Reporter {
|
||||
addReporter(reporter: Reporter): void;
|
||||
}
|
||||
|
||||
interface Runner {
|
||||
|
||||
new (env: Env): any;
|
||||
|
||||
execute(): void;
|
||||
beforeEach(beforeEachFunction: SpecFunction): void;
|
||||
afterEach(afterEachFunction: SpecFunction): void;
|
||||
beforeAll(beforeAllFunction: SpecFunction): void;
|
||||
afterAll(afterAllFunction: SpecFunction): void;
|
||||
finishCallback(): void;
|
||||
addSuite(suite: Suite): void;
|
||||
add(block: Block): void;
|
||||
specs(): Spec[];
|
||||
suites(): Suite[];
|
||||
topLevelSuites(): Suite[];
|
||||
results(): NestedResults;
|
||||
}
|
||||
|
||||
interface SpecFunction {
|
||||
(spec?: Spec): void;
|
||||
}
|
||||
|
||||
interface SuiteOrSpec {
|
||||
id: number;
|
||||
env: Env;
|
||||
description: string;
|
||||
queue: Queue;
|
||||
}
|
||||
|
||||
interface Spec extends SuiteOrSpec {
|
||||
|
||||
new (env: Env, suite: Suite, description: string): any;
|
||||
|
||||
suite: Suite;
|
||||
|
||||
afterCallbacks: SpecFunction[];
|
||||
spies_: Spy[];
|
||||
|
||||
results_: NestedResults;
|
||||
matchersClass: Matchers;
|
||||
|
||||
getFullName(): string;
|
||||
results(): NestedResults;
|
||||
log(arguments: any): any;
|
||||
runs(func: SpecFunction): Spec;
|
||||
addToQueue(block: Block): void;
|
||||
addMatcherResult(result: Result): void;
|
||||
expect(actual: any): any;
|
||||
waits(timeout: number): Spec;
|
||||
waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec;
|
||||
fail(e?: any): void;
|
||||
getMatchersClass_(): Matchers;
|
||||
addMatchers(matchersPrototype: CustomMatcherFactories): void;
|
||||
finishCallback(): void;
|
||||
finish(onComplete?: () => void): void;
|
||||
after(doAfter: SpecFunction): void;
|
||||
execute(onComplete?: () => void): any;
|
||||
addBeforesAndAftersToQueue(): void;
|
||||
explodes(): void;
|
||||
spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy;
|
||||
removeAllSpies(): void;
|
||||
}
|
||||
|
||||
interface XSpec {
|
||||
id: number;
|
||||
runs(): void;
|
||||
}
|
||||
|
||||
interface Suite extends SuiteOrSpec {
|
||||
|
||||
new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any;
|
||||
|
||||
parentSuite: Suite;
|
||||
|
||||
getFullName(): string;
|
||||
finish(onComplete?: () => void): void;
|
||||
beforeEach(beforeEachFunction: SpecFunction): void;
|
||||
afterEach(afterEachFunction: SpecFunction): void;
|
||||
beforeAll(beforeAllFunction: SpecFunction): void;
|
||||
afterAll(afterAllFunction: SpecFunction): void;
|
||||
results(): NestedResults;
|
||||
add(suiteOrSpec: SuiteOrSpec): void;
|
||||
specs(): Spec[];
|
||||
suites(): Suite[];
|
||||
children(): any[];
|
||||
execute(onComplete?: () => void): void;
|
||||
}
|
||||
|
||||
interface XSuite {
|
||||
execute(): void;
|
||||
}
|
||||
|
||||
interface Spy {
|
||||
(...params: any[]): any;
|
||||
|
||||
identity: string;
|
||||
and: SpyAnd;
|
||||
calls: Calls;
|
||||
mostRecentCall: { args: any[]; };
|
||||
argsForCall: any[];
|
||||
wasCalled: boolean;
|
||||
callCount: number;
|
||||
}
|
||||
|
||||
interface SpyAnd {
|
||||
/** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */
|
||||
callThrough(): Spy;
|
||||
/** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */
|
||||
returnValue(val: any): void;
|
||||
/** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */
|
||||
callFake(fn: Function): Spy;
|
||||
/** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */
|
||||
throwError(msg: string): void;
|
||||
/** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */
|
||||
stub(): Spy;
|
||||
}
|
||||
|
||||
interface Calls {
|
||||
/** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/
|
||||
any(): boolean;
|
||||
/** By chaining the spy with calls.count(), will return the number of times the spy was called **/
|
||||
count(): number;
|
||||
/** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/
|
||||
argsFor(index: number): any[];
|
||||
/** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/
|
||||
allArgs(): any[];
|
||||
/** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/
|
||||
all(): CallInfo[];
|
||||
/** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/
|
||||
mostRecent(): CallInfo;
|
||||
/** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/
|
||||
first(): CallInfo;
|
||||
/** By chaining the spy with calls.reset(), will clears all tracking for a spy **/
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
interface CallInfo {
|
||||
/** The context (the this) for the call */
|
||||
object: any;
|
||||
/** All arguments passed to the call */
|
||||
args: any[];
|
||||
}
|
||||
|
||||
interface Util {
|
||||
inherit(childClass: Function, parentClass: Function): any;
|
||||
formatException(e: any): any;
|
||||
htmlEscape(str: string): string;
|
||||
argsToArray(args: any): any;
|
||||
extend(destination: any, source: any): any;
|
||||
}
|
||||
|
||||
interface JsApiReporter extends Reporter {
|
||||
|
||||
started: boolean;
|
||||
finished: boolean;
|
||||
result: any;
|
||||
messages: any;
|
||||
|
||||
new (): any;
|
||||
|
||||
suites(): Suite[];
|
||||
summarize_(suiteOrSpec: SuiteOrSpec): any;
|
||||
results(): any;
|
||||
resultsForSpec(specId: any): any;
|
||||
log(str: any): any;
|
||||
resultsForSpecs(specIds: any): any;
|
||||
summarizeResult_(result: any): any;
|
||||
}
|
||||
|
||||
interface Jasmine {
|
||||
Spec: Spec;
|
||||
clock: Clock;
|
||||
util: Util;
|
||||
}
|
||||
|
||||
export var HtmlReporter: HtmlReporter;
|
||||
export var HtmlSpecFilter: HtmlSpecFilter;
|
||||
export var DEFAULT_TIMEOUT_INTERVAL: number;
|
||||
|
||||
export interface GlobalPolluter {
|
||||
describe(description: string, specDefinitions: () => void): void;
|
||||
fdescribe(description: string, specDefinitions: () => void): void;
|
||||
xdescribe(description: string, specDefinitions: () => void): void;
|
||||
|
||||
it(expectation: string, assertion?: () => void): void;
|
||||
it(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
fit(expectation: string, assertion?: () => void): void;
|
||||
fit(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
xit(expectation: string, assertion?: () => void): void;
|
||||
xit(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
|
||||
pending(): void;
|
||||
|
||||
beforeEach(action: () => void): void;
|
||||
beforeEach(action: (done: () => void) => void): void;
|
||||
afterEach(action: () => void): void;
|
||||
afterEach(action: (done: () => void) => void): void;
|
||||
|
||||
beforeAll(action: () => void): void;
|
||||
beforeAll(action: (done: () => void) => void): void;
|
||||
afterAll(action: () => void): void;
|
||||
afterAll(action: (done: () => void) => void): void;
|
||||
|
||||
expect(spy: Function): jasmine.Matchers;
|
||||
expect(actual: any): jasmine.Matchers;
|
||||
|
||||
fail(e?: any): void;
|
||||
|
||||
spyOn(object: any, method: string): jasmine.Spy;
|
||||
|
||||
runs(asyncMethod: Function): void;
|
||||
waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void;
|
||||
waits(timeout?: number): void;
|
||||
}
|
||||
}
|
|
@ -1,777 +0,0 @@
|
|||
"format register";
|
||||
System.register("angular2/src/upgrade/metadata", ["angular2/core"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var core_1 = require("angular2/core");
|
||||
var COMPONENT_SELECTOR = /^[\w|-]*$/;
|
||||
var SKEWER_CASE = /-(\w)/g;
|
||||
var directiveResolver = new core_1.DirectiveResolver();
|
||||
function getComponentInfo(type) {
|
||||
var resolvedMetadata = directiveResolver.resolve(type);
|
||||
var selector = resolvedMetadata.selector;
|
||||
if (!selector.match(COMPONENT_SELECTOR)) {
|
||||
throw new Error('Only selectors matching element names are supported, got: ' + selector);
|
||||
}
|
||||
var selector = selector.replace(SKEWER_CASE, function(all, letter) {
|
||||
return letter.toUpperCase();
|
||||
});
|
||||
return {
|
||||
type: type,
|
||||
selector: selector,
|
||||
inputs: parseFields(resolvedMetadata.inputs),
|
||||
outputs: parseFields(resolvedMetadata.outputs)
|
||||
};
|
||||
}
|
||||
exports.getComponentInfo = getComponentInfo;
|
||||
function parseFields(names) {
|
||||
var attrProps = [];
|
||||
if (names) {
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
var parts = names[i].split(':');
|
||||
var prop = parts[0].trim();
|
||||
var attr = (parts[1] || parts[0]).trim();
|
||||
var capitalAttr = attr.charAt(0).toUpperCase() + attr.substr(1);
|
||||
attrProps.push({
|
||||
prop: prop,
|
||||
attr: attr,
|
||||
bracketAttr: "[" + attr + "]",
|
||||
parenAttr: "(" + attr + ")",
|
||||
bracketParenAttr: "[(" + attr + ")]",
|
||||
onAttr: "on" + capitalAttr,
|
||||
bindAttr: "bind" + capitalAttr,
|
||||
bindonAttr: "bindon" + capitalAttr
|
||||
});
|
||||
}
|
||||
}
|
||||
return attrProps;
|
||||
}
|
||||
exports.parseFields = parseFields;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/util", [], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
function stringify(obj) {
|
||||
if (typeof obj == 'function')
|
||||
return obj.name || obj.toString();
|
||||
return '' + obj;
|
||||
}
|
||||
exports.stringify = stringify;
|
||||
function onError(e) {
|
||||
console.log(e, e.stack);
|
||||
throw e;
|
||||
}
|
||||
exports.onError = onError;
|
||||
function controllerKey(name) {
|
||||
return '$' + name + 'Controller';
|
||||
}
|
||||
exports.controllerKey = controllerKey;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/constants", [], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
exports.NG2_APP_VIEW_MANAGER = 'ng2.AppViewManager';
|
||||
exports.NG2_COMPILER = 'ng2.Compiler';
|
||||
exports.NG2_INJECTOR = 'ng2.Injector';
|
||||
exports.NG2_HOST_VIEW_FACTORY_REF_MAP = 'ng2.HostViewFactoryRefMap';
|
||||
exports.NG2_ZONE = 'ng2.NgZone';
|
||||
exports.NG1_CONTROLLER = '$controller';
|
||||
exports.NG1_SCOPE = '$scope';
|
||||
exports.NG1_ROOT_SCOPE = '$rootScope';
|
||||
exports.NG1_COMPILE = '$compile';
|
||||
exports.NG1_HTTP_BACKEND = '$httpBackend';
|
||||
exports.NG1_INJECTOR = '$injector';
|
||||
exports.NG1_PARSE = '$parse';
|
||||
exports.NG1_TEMPLATE_CACHE = '$templateCache';
|
||||
exports.REQUIRE_INJECTOR = '^' + exports.NG2_INJECTOR;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/downgrade_ng2_adapter", ["angular2/core", "angular2/src/upgrade/constants"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var core_1 = require("angular2/core");
|
||||
var constants_1 = require("angular2/src/upgrade/constants");
|
||||
var INITIAL_VALUE = {__UNINITIALIZED__: true};
|
||||
var DowngradeNg2ComponentAdapter = (function() {
|
||||
function DowngradeNg2ComponentAdapter(id, info, element, attrs, scope, parentInjector, parse, viewManager, hostViewFactory) {
|
||||
this.id = id;
|
||||
this.info = info;
|
||||
this.element = element;
|
||||
this.attrs = attrs;
|
||||
this.scope = scope;
|
||||
this.parentInjector = parentInjector;
|
||||
this.parse = parse;
|
||||
this.viewManager = viewManager;
|
||||
this.hostViewFactory = hostViewFactory;
|
||||
this.component = null;
|
||||
this.inputChangeCount = 0;
|
||||
this.inputChanges = null;
|
||||
this.hostViewRef = null;
|
||||
this.changeDetector = null;
|
||||
this.contentInsertionPoint = null;
|
||||
this.element[0].id = id;
|
||||
this.componentScope = scope.$new();
|
||||
this.childNodes = element.contents();
|
||||
}
|
||||
DowngradeNg2ComponentAdapter.prototype.bootstrapNg2 = function() {
|
||||
var childInjector = this.parentInjector.resolveAndCreateChild([core_1.provide(constants_1.NG1_SCOPE, {useValue: this.componentScope})]);
|
||||
this.contentInsertionPoint = document.createComment('ng1 insertion point');
|
||||
this.hostViewRef = this.viewManager.createRootHostView(this.hostViewFactory, '#' + this.id, childInjector, [[this.contentInsertionPoint]]);
|
||||
var hostElement = this.viewManager.getHostElement(this.hostViewRef);
|
||||
this.changeDetector = this.hostViewRef.changeDetectorRef;
|
||||
this.component = this.viewManager.getComponent(hostElement);
|
||||
};
|
||||
DowngradeNg2ComponentAdapter.prototype.setupInputs = function() {
|
||||
var _this = this;
|
||||
var attrs = this.attrs;
|
||||
var inputs = this.info.inputs;
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
var input = inputs[i];
|
||||
var expr = null;
|
||||
if (attrs.hasOwnProperty(input.attr)) {
|
||||
var observeFn = (function(prop) {
|
||||
var prevValue = INITIAL_VALUE;
|
||||
return function(value) {
|
||||
if (_this.inputChanges !== null) {
|
||||
_this.inputChangeCount++;
|
||||
_this.inputChanges[prop] = new Ng1Change(value, prevValue === INITIAL_VALUE ? value : prevValue);
|
||||
prevValue = value;
|
||||
}
|
||||
_this.component[prop] = value;
|
||||
};
|
||||
})(input.prop);
|
||||
attrs.$observe(input.attr, observeFn);
|
||||
} else if (attrs.hasOwnProperty(input.bindAttr)) {
|
||||
expr = attrs[input.bindAttr];
|
||||
} else if (attrs.hasOwnProperty(input.bracketAttr)) {
|
||||
expr = attrs[input.bracketAttr];
|
||||
} else if (attrs.hasOwnProperty(input.bindonAttr)) {
|
||||
expr = attrs[input.bindonAttr];
|
||||
} else if (attrs.hasOwnProperty(input.bracketParenAttr)) {
|
||||
expr = attrs[input.bracketParenAttr];
|
||||
}
|
||||
if (expr != null) {
|
||||
var watchFn = (function(prop) {
|
||||
return function(value, prevValue) {
|
||||
if (_this.inputChanges != null) {
|
||||
_this.inputChangeCount++;
|
||||
_this.inputChanges[prop] = new Ng1Change(prevValue, value);
|
||||
}
|
||||
_this.component[prop] = value;
|
||||
};
|
||||
})(input.prop);
|
||||
this.componentScope.$watch(expr, watchFn);
|
||||
}
|
||||
}
|
||||
var prototype = this.info.type.prototype;
|
||||
if (prototype && prototype.ngOnChanges) {
|
||||
this.inputChanges = {};
|
||||
this.componentScope.$watch(function() {
|
||||
return _this.inputChangeCount;
|
||||
}, function() {
|
||||
var inputChanges = _this.inputChanges;
|
||||
_this.inputChanges = {};
|
||||
_this.component.ngOnChanges(inputChanges);
|
||||
});
|
||||
}
|
||||
this.componentScope.$watch(function() {
|
||||
return _this.changeDetector && _this.changeDetector.detectChanges();
|
||||
});
|
||||
};
|
||||
DowngradeNg2ComponentAdapter.prototype.projectContent = function() {
|
||||
var childNodes = this.childNodes;
|
||||
var parent = this.contentInsertionPoint.parentNode;
|
||||
if (parent) {
|
||||
for (var i = 0,
|
||||
ii = childNodes.length; i < ii; i++) {
|
||||
parent.insertBefore(childNodes[i], this.contentInsertionPoint);
|
||||
}
|
||||
}
|
||||
};
|
||||
DowngradeNg2ComponentAdapter.prototype.setupOutputs = function() {
|
||||
var _this = this;
|
||||
var attrs = this.attrs;
|
||||
var outputs = this.info.outputs;
|
||||
for (var j = 0; j < outputs.length; j++) {
|
||||
var output = outputs[j];
|
||||
var expr = null;
|
||||
var assignExpr = false;
|
||||
var bindonAttr = output.bindonAttr ? output.bindonAttr.substring(0, output.bindonAttr.length - 6) : null;
|
||||
var bracketParenAttr = output.bracketParenAttr ? "[(" + output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8) + ")]" : null;
|
||||
if (attrs.hasOwnProperty(output.onAttr)) {
|
||||
expr = attrs[output.onAttr];
|
||||
} else if (attrs.hasOwnProperty(output.parenAttr)) {
|
||||
expr = attrs[output.parenAttr];
|
||||
} else if (attrs.hasOwnProperty(bindonAttr)) {
|
||||
expr = attrs[bindonAttr];
|
||||
assignExpr = true;
|
||||
} else if (attrs.hasOwnProperty(bracketParenAttr)) {
|
||||
expr = attrs[bracketParenAttr];
|
||||
assignExpr = true;
|
||||
}
|
||||
if (expr != null && assignExpr != null) {
|
||||
var getter = this.parse(expr);
|
||||
var setter = getter.assign;
|
||||
if (assignExpr && !setter) {
|
||||
throw new Error("Expression '" + expr + "' is not assignable!");
|
||||
}
|
||||
var emitter = this.component[output.prop];
|
||||
if (emitter) {
|
||||
emitter.subscribe({next: assignExpr ? (function(setter) {
|
||||
return function(value) {
|
||||
return setter(_this.scope, value);
|
||||
};
|
||||
})(setter) : (function(getter) {
|
||||
return function(value) {
|
||||
return getter(_this.scope, {$event: value});
|
||||
};
|
||||
})(getter)});
|
||||
} else {
|
||||
throw new Error("Missing emitter '" + output.prop + "' on component '" + this.info.selector + "'!");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
DowngradeNg2ComponentAdapter.prototype.registerCleanup = function() {
|
||||
var _this = this;
|
||||
this.element.bind('$remove', function() {
|
||||
return _this.viewManager.destroyRootHostView(_this.hostViewRef);
|
||||
});
|
||||
};
|
||||
return DowngradeNg2ComponentAdapter;
|
||||
})();
|
||||
exports.DowngradeNg2ComponentAdapter = DowngradeNg2ComponentAdapter;
|
||||
var Ng1Change = (function() {
|
||||
function Ng1Change(previousValue, currentValue) {
|
||||
this.previousValue = previousValue;
|
||||
this.currentValue = currentValue;
|
||||
}
|
||||
Ng1Change.prototype.isFirstChange = function() {
|
||||
return this.previousValue === this.currentValue;
|
||||
};
|
||||
return Ng1Change;
|
||||
})();
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/angular_js", [], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
function noNg() {
|
||||
throw new Error('AngularJS v1.x is not loaded!');
|
||||
}
|
||||
var angular = {
|
||||
bootstrap: noNg,
|
||||
module: noNg,
|
||||
element: noNg,
|
||||
version: noNg
|
||||
};
|
||||
try {
|
||||
if (window.hasOwnProperty('angular')) {
|
||||
angular = window.angular;
|
||||
}
|
||||
} catch (e) {}
|
||||
exports.bootstrap = angular.bootstrap;
|
||||
exports.module = angular.module;
|
||||
exports.element = angular.element;
|
||||
exports.version = angular.version;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/upgrade_ng1_adapter", ["angular2/core", "angular2/src/upgrade/constants", "angular2/src/upgrade/util", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var core_1 = require("angular2/core");
|
||||
var constants_1 = require("angular2/src/upgrade/constants");
|
||||
var util_1 = require("angular2/src/upgrade/util");
|
||||
var angular = require("angular2/src/upgrade/angular_js");
|
||||
var CAMEL_CASE = /([A-Z])/g;
|
||||
var INITIAL_VALUE = {__UNINITIALIZED__: true};
|
||||
var NOT_SUPPORTED = 'NOT_SUPPORTED';
|
||||
var UpgradeNg1ComponentAdapterBuilder = (function() {
|
||||
function UpgradeNg1ComponentAdapterBuilder(name) {
|
||||
this.name = name;
|
||||
this.inputs = [];
|
||||
this.inputsRename = [];
|
||||
this.outputs = [];
|
||||
this.outputsRename = [];
|
||||
this.propertyOutputs = [];
|
||||
this.checkProperties = [];
|
||||
this.propertyMap = {};
|
||||
this.linkFn = null;
|
||||
this.directive = null;
|
||||
this.$controller = null;
|
||||
var selector = name.replace(CAMEL_CASE, function(all, next) {
|
||||
return '-' + next.toLowerCase();
|
||||
});
|
||||
var self = this;
|
||||
this.type = core_1.Directive({
|
||||
selector: selector,
|
||||
inputs: this.inputsRename,
|
||||
outputs: this.outputsRename
|
||||
}).Class({
|
||||
constructor: [new core_1.Inject(constants_1.NG1_SCOPE), core_1.ElementRef, function(scope, elementRef) {
|
||||
return new UpgradeNg1ComponentAdapter(self.linkFn, scope, self.directive, elementRef, self.$controller, self.inputs, self.outputs, self.propertyOutputs, self.checkProperties, self.propertyMap);
|
||||
}],
|
||||
ngOnChanges: function() {},
|
||||
ngDoCheck: function() {}
|
||||
});
|
||||
}
|
||||
UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective = function(injector) {
|
||||
var directives = injector.get(this.name + 'Directive');
|
||||
if (directives.length > 1) {
|
||||
throw new Error('Only support single directive definition for: ' + this.name);
|
||||
}
|
||||
var directive = directives[0];
|
||||
if (directive.replace)
|
||||
this.notSupported('replace');
|
||||
if (directive.terminal)
|
||||
this.notSupported('terminal');
|
||||
var link = directive.link;
|
||||
if (typeof link == 'object') {
|
||||
if (link.post)
|
||||
this.notSupported('link.post');
|
||||
}
|
||||
return directive;
|
||||
};
|
||||
UpgradeNg1ComponentAdapterBuilder.prototype.notSupported = function(feature) {
|
||||
throw new Error("Upgraded directive '" + this.name + "' does not support '" + feature + "'.");
|
||||
};
|
||||
UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings = function() {
|
||||
var btcIsObject = typeof this.directive.bindToController === 'object';
|
||||
if (btcIsObject && Object.keys(this.directive.scope).length) {
|
||||
throw new Error("Binding definitions on scope and controller at the same time are not supported.");
|
||||
}
|
||||
var context = (btcIsObject) ? this.directive.bindToController : this.directive.scope;
|
||||
if (typeof context == 'object') {
|
||||
for (var name in context) {
|
||||
if (context.hasOwnProperty(name)) {
|
||||
var localName = context[name];
|
||||
var type = localName.charAt(0);
|
||||
localName = localName.substr(1) || name;
|
||||
var outputName = 'output_' + name;
|
||||
var outputNameRename = outputName + ': ' + name;
|
||||
var outputNameRenameChange = outputName + ': ' + name + 'Change';
|
||||
var inputName = 'input_' + name;
|
||||
var inputNameRename = inputName + ': ' + name;
|
||||
switch (type) {
|
||||
case '=':
|
||||
this.propertyOutputs.push(outputName);
|
||||
this.checkProperties.push(localName);
|
||||
this.outputs.push(outputName);
|
||||
this.outputsRename.push(outputNameRenameChange);
|
||||
this.propertyMap[outputName] = localName;
|
||||
case '@':
|
||||
this.inputs.push(inputName);
|
||||
this.inputsRename.push(inputNameRename);
|
||||
this.propertyMap[inputName] = localName;
|
||||
break;
|
||||
case '&':
|
||||
this.outputs.push(outputName);
|
||||
this.outputsRename.push(outputNameRename);
|
||||
this.propertyMap[outputName] = localName;
|
||||
break;
|
||||
default:
|
||||
var json = JSON.stringify(context);
|
||||
throw new Error("Unexpected mapping '" + type + "' in '" + json + "' in '" + this.name + "' directive.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate = function(compile, templateCache, httpBackend) {
|
||||
var _this = this;
|
||||
if (this.directive.template !== undefined) {
|
||||
this.linkFn = compileHtml(this.directive.template);
|
||||
} else if (this.directive.templateUrl) {
|
||||
var url = this.directive.templateUrl;
|
||||
var html = templateCache.get(url);
|
||||
if (html !== undefined) {
|
||||
this.linkFn = compileHtml(html);
|
||||
} else {
|
||||
return new Promise(function(resolve, err) {
|
||||
httpBackend('GET', url, null, function(status, response) {
|
||||
if (status == 200) {
|
||||
resolve(_this.linkFn = compileHtml(templateCache.put(url, response)));
|
||||
} else {
|
||||
err("GET " + url + " returned " + status + ": " + response);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
throw new Error("Directive '" + this.name + "' is not a component, it is missing template.");
|
||||
}
|
||||
return null;
|
||||
function compileHtml(html) {
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = html;
|
||||
return compile(div.childNodes);
|
||||
}
|
||||
};
|
||||
UpgradeNg1ComponentAdapterBuilder.resolve = function(exportedComponents, injector) {
|
||||
var promises = [];
|
||||
var compile = injector.get(constants_1.NG1_COMPILE);
|
||||
var templateCache = injector.get(constants_1.NG1_TEMPLATE_CACHE);
|
||||
var httpBackend = injector.get(constants_1.NG1_HTTP_BACKEND);
|
||||
var $controller = injector.get(constants_1.NG1_CONTROLLER);
|
||||
for (var name in exportedComponents) {
|
||||
if (exportedComponents.hasOwnProperty(name)) {
|
||||
var exportedComponent = exportedComponents[name];
|
||||
exportedComponent.directive = exportedComponent.extractDirective(injector);
|
||||
exportedComponent.$controller = $controller;
|
||||
exportedComponent.extractBindings();
|
||||
var promise = exportedComponent.compileTemplate(compile, templateCache, httpBackend);
|
||||
if (promise)
|
||||
promises.push(promise);
|
||||
}
|
||||
}
|
||||
return Promise.all(promises);
|
||||
};
|
||||
return UpgradeNg1ComponentAdapterBuilder;
|
||||
})();
|
||||
exports.UpgradeNg1ComponentAdapterBuilder = UpgradeNg1ComponentAdapterBuilder;
|
||||
var UpgradeNg1ComponentAdapter = (function() {
|
||||
function UpgradeNg1ComponentAdapter(linkFn, scope, directive, elementRef, $controller, inputs, outputs, propOuts, checkProperties, propertyMap) {
|
||||
this.directive = directive;
|
||||
this.inputs = inputs;
|
||||
this.outputs = outputs;
|
||||
this.propOuts = propOuts;
|
||||
this.checkProperties = checkProperties;
|
||||
this.propertyMap = propertyMap;
|
||||
this.destinationObj = null;
|
||||
this.checkLastValues = [];
|
||||
var element = elementRef.nativeElement;
|
||||
var childNodes = [];
|
||||
var childNode;
|
||||
while (childNode = element.firstChild) {
|
||||
element.removeChild(childNode);
|
||||
childNodes.push(childNode);
|
||||
}
|
||||
var componentScope = scope.$new(!!directive.scope);
|
||||
var $element = angular.element(element);
|
||||
var controllerType = directive.controller;
|
||||
var controller = null;
|
||||
if (controllerType) {
|
||||
var locals = {
|
||||
$scope: componentScope,
|
||||
$element: $element
|
||||
};
|
||||
controller = $controller(controllerType, locals, null, directive.controllerAs);
|
||||
$element.data(util_1.controllerKey(directive.name), controller);
|
||||
}
|
||||
var link = directive.link;
|
||||
if (typeof link == 'object')
|
||||
link = link.pre;
|
||||
if (link) {
|
||||
var attrs = NOT_SUPPORTED;
|
||||
var transcludeFn = NOT_SUPPORTED;
|
||||
var linkController = this.resolveRequired($element, directive.require);
|
||||
directive.link(componentScope, $element, attrs, linkController, transcludeFn);
|
||||
}
|
||||
this.destinationObj = directive.bindToController && controller ? controller : componentScope;
|
||||
linkFn(componentScope, function(clonedElement, scope) {
|
||||
for (var i = 0,
|
||||
ii = clonedElement.length; i < ii; i++) {
|
||||
element.appendChild(clonedElement[i]);
|
||||
}
|
||||
}, {parentBoundTranscludeFn: function(scope, cloneAttach) {
|
||||
cloneAttach(childNodes);
|
||||
}});
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
this[inputs[i]] = null;
|
||||
}
|
||||
for (var j = 0; j < outputs.length; j++) {
|
||||
var emitter = this[outputs[j]] = new core_1.EventEmitter();
|
||||
this.setComponentProperty(outputs[j], (function(emitter) {
|
||||
return function(value) {
|
||||
return emitter.emit(value);
|
||||
};
|
||||
})(emitter));
|
||||
}
|
||||
for (var k = 0; k < propOuts.length; k++) {
|
||||
this[propOuts[k]] = new core_1.EventEmitter();
|
||||
this.checkLastValues.push(INITIAL_VALUE);
|
||||
}
|
||||
}
|
||||
UpgradeNg1ComponentAdapter.prototype.ngOnChanges = function(changes) {
|
||||
for (var name in changes) {
|
||||
if (changes.hasOwnProperty(name)) {
|
||||
var change = changes[name];
|
||||
this.setComponentProperty(name, change.currentValue);
|
||||
}
|
||||
}
|
||||
};
|
||||
UpgradeNg1ComponentAdapter.prototype.ngDoCheck = function() {
|
||||
var count = 0;
|
||||
var destinationObj = this.destinationObj;
|
||||
var lastValues = this.checkLastValues;
|
||||
var checkProperties = this.checkProperties;
|
||||
for (var i = 0; i < checkProperties.length; i++) {
|
||||
var value = destinationObj[checkProperties[i]];
|
||||
var last = lastValues[i];
|
||||
if (value !== last) {
|
||||
if (typeof value == 'number' && isNaN(value) && typeof last == 'number' && isNaN(last)) {} else {
|
||||
var eventEmitter = this[this.propOuts[i]];
|
||||
eventEmitter.emit(lastValues[i] = value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
};
|
||||
UpgradeNg1ComponentAdapter.prototype.setComponentProperty = function(name, value) {
|
||||
this.destinationObj[this.propertyMap[name]] = value;
|
||||
};
|
||||
UpgradeNg1ComponentAdapter.prototype.resolveRequired = function($element, require) {
|
||||
if (!require) {
|
||||
return undefined;
|
||||
} else if (typeof require == 'string') {
|
||||
var name = require;
|
||||
var isOptional = false;
|
||||
var startParent = false;
|
||||
var searchParents = false;
|
||||
var ch;
|
||||
if (name.charAt(0) == '?') {
|
||||
isOptional = true;
|
||||
name = name.substr(1);
|
||||
}
|
||||
if (name.charAt(0) == '^') {
|
||||
searchParents = true;
|
||||
name = name.substr(1);
|
||||
}
|
||||
if (name.charAt(0) == '^') {
|
||||
startParent = true;
|
||||
name = name.substr(1);
|
||||
}
|
||||
var key = util_1.controllerKey(name);
|
||||
if (startParent)
|
||||
$element = $element.parent();
|
||||
var dep = searchParents ? $element.inheritedData(key) : $element.data(key);
|
||||
if (!dep && !isOptional) {
|
||||
throw new Error("Can not locate '" + require + "' in '" + this.directive.name + "'.");
|
||||
}
|
||||
return dep;
|
||||
} else if (require instanceof Array) {
|
||||
var deps = [];
|
||||
for (var i = 0; i < require.length; i++) {
|
||||
deps.push(this.resolveRequired($element, require[i]));
|
||||
}
|
||||
return deps;
|
||||
}
|
||||
throw new Error("Directive '" + this.directive.name + "' require syntax unrecognized: " + this.directive.require);
|
||||
};
|
||||
return UpgradeNg1ComponentAdapter;
|
||||
})();
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/upgrade_adapter", ["angular2/core", "angular2/src/facade/async", "angular2/platform/browser", "angular2/src/upgrade/metadata", "angular2/src/upgrade/util", "angular2/src/upgrade/constants", "angular2/src/upgrade/downgrade_ng2_adapter", "angular2/src/upgrade/upgrade_ng1_adapter", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var core_1 = require("angular2/core");
|
||||
var async_1 = require("angular2/src/facade/async");
|
||||
var browser_1 = require("angular2/platform/browser");
|
||||
var metadata_1 = require("angular2/src/upgrade/metadata");
|
||||
var util_1 = require("angular2/src/upgrade/util");
|
||||
var constants_1 = require("angular2/src/upgrade/constants");
|
||||
var downgrade_ng2_adapter_1 = require("angular2/src/upgrade/downgrade_ng2_adapter");
|
||||
var upgrade_ng1_adapter_1 = require("angular2/src/upgrade/upgrade_ng1_adapter");
|
||||
var angular = require("angular2/src/upgrade/angular_js");
|
||||
var upgradeCount = 0;
|
||||
var UpgradeAdapter = (function() {
|
||||
function UpgradeAdapter() {
|
||||
this.idPrefix = "NG2_UPGRADE_" + upgradeCount++ + "_";
|
||||
this.upgradedComponents = [];
|
||||
this.downgradedComponents = {};
|
||||
this.providers = [];
|
||||
}
|
||||
UpgradeAdapter.prototype.downgradeNg2Component = function(type) {
|
||||
this.upgradedComponents.push(type);
|
||||
var info = metadata_1.getComponentInfo(type);
|
||||
return ng1ComponentDirective(info, "" + this.idPrefix + info.selector + "_c");
|
||||
};
|
||||
UpgradeAdapter.prototype.upgradeNg1Component = function(name) {
|
||||
if (this.downgradedComponents.hasOwnProperty(name)) {
|
||||
return this.downgradedComponents[name].type;
|
||||
} else {
|
||||
return (this.downgradedComponents[name] = new upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder(name)).type;
|
||||
}
|
||||
};
|
||||
UpgradeAdapter.prototype.bootstrap = function(element, modules, config) {
|
||||
var _this = this;
|
||||
var upgrade = new UpgradeAdapterRef();
|
||||
var ng1Injector = null;
|
||||
var platformRef = core_1.platform(browser_1.BROWSER_PROVIDERS);
|
||||
var applicationRef = platformRef.application([browser_1.BROWSER_APP_PROVIDERS, core_1.provide(constants_1.NG1_INJECTOR, {useFactory: function() {
|
||||
return ng1Injector;
|
||||
}}), core_1.provide(constants_1.NG1_COMPILE, {useFactory: function() {
|
||||
return ng1Injector.get(constants_1.NG1_COMPILE);
|
||||
}}), this.providers]);
|
||||
var injector = applicationRef.injector;
|
||||
var ngZone = injector.get(core_1.NgZone);
|
||||
var compiler = injector.get(core_1.Compiler);
|
||||
var delayApplyExps = [];
|
||||
var original$applyFn;
|
||||
var rootScopePrototype;
|
||||
var rootScope;
|
||||
var hostViewFactoryRefMap = {};
|
||||
var ng1Module = angular.module(this.idPrefix, modules);
|
||||
var ng1compilePromise = null;
|
||||
ng1Module.value(constants_1.NG2_INJECTOR, injector).value(constants_1.NG2_ZONE, ngZone).value(constants_1.NG2_COMPILER, compiler).value(constants_1.NG2_HOST_VIEW_FACTORY_REF_MAP, hostViewFactoryRefMap).value(constants_1.NG2_APP_VIEW_MANAGER, injector.get(core_1.AppViewManager)).config(['$provide', function(provide) {
|
||||
provide.decorator(constants_1.NG1_ROOT_SCOPE, ['$delegate', function(rootScopeDelegate) {
|
||||
rootScopePrototype = rootScopeDelegate.constructor.prototype;
|
||||
if (rootScopePrototype.hasOwnProperty('$apply')) {
|
||||
original$applyFn = rootScopePrototype.$apply;
|
||||
rootScopePrototype.$apply = function(exp) {
|
||||
return delayApplyExps.push(exp);
|
||||
};
|
||||
} else {
|
||||
throw new Error("Failed to find '$apply' on '$rootScope'!");
|
||||
}
|
||||
return rootScope = rootScopeDelegate;
|
||||
}]);
|
||||
}]).run(['$injector', '$rootScope', function(injector, rootScope) {
|
||||
ng1Injector = injector;
|
||||
async_1.ObservableWrapper.subscribe(ngZone.onTurnDone, function(_) {
|
||||
ngZone.run(function() {
|
||||
return rootScope.$apply();
|
||||
});
|
||||
});
|
||||
ng1compilePromise = upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder.resolve(_this.downgradedComponents, injector);
|
||||
}]);
|
||||
angular.element(element).data(util_1.controllerKey(constants_1.NG2_INJECTOR), injector);
|
||||
ngZone.run(function() {
|
||||
angular.bootstrap(element, [_this.idPrefix], config);
|
||||
});
|
||||
Promise.all([this.compileNg2Components(compiler, hostViewFactoryRefMap), ng1compilePromise]).then(function() {
|
||||
ngZone.run(function() {
|
||||
if (rootScopePrototype) {
|
||||
rootScopePrototype.$apply = original$applyFn;
|
||||
while (delayApplyExps.length) {
|
||||
rootScope.$apply(delayApplyExps.shift());
|
||||
}
|
||||
upgrade._bootstrapDone(applicationRef, ng1Injector);
|
||||
rootScopePrototype = null;
|
||||
}
|
||||
});
|
||||
}, util_1.onError);
|
||||
return upgrade;
|
||||
};
|
||||
UpgradeAdapter.prototype.addProvider = function(provider) {
|
||||
this.providers.push(provider);
|
||||
};
|
||||
UpgradeAdapter.prototype.upgradeNg1Provider = function(name, options) {
|
||||
var token = options && options.asToken || name;
|
||||
this.providers.push(core_1.provide(token, {
|
||||
useFactory: function(ng1Injector) {
|
||||
return ng1Injector.get(name);
|
||||
},
|
||||
deps: [constants_1.NG1_INJECTOR]
|
||||
}));
|
||||
};
|
||||
UpgradeAdapter.prototype.downgradeNg2Provider = function(token) {
|
||||
var factory = function(injector) {
|
||||
return injector.get(token);
|
||||
};
|
||||
factory.$inject = [constants_1.NG2_INJECTOR];
|
||||
return factory;
|
||||
};
|
||||
UpgradeAdapter.prototype.compileNg2Components = function(compiler, hostViewFactoryRefMap) {
|
||||
var _this = this;
|
||||
var promises = [];
|
||||
var types = this.upgradedComponents;
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
promises.push(compiler.compileInHost(types[i]));
|
||||
}
|
||||
return Promise.all(promises).then(function(hostViewFactories) {
|
||||
var types = _this.upgradedComponents;
|
||||
for (var i = 0; i < hostViewFactories.length; i++) {
|
||||
hostViewFactoryRefMap[metadata_1.getComponentInfo(types[i]).selector] = hostViewFactories[i];
|
||||
}
|
||||
return hostViewFactoryRefMap;
|
||||
}, util_1.onError);
|
||||
};
|
||||
return UpgradeAdapter;
|
||||
})();
|
||||
exports.UpgradeAdapter = UpgradeAdapter;
|
||||
function ng1ComponentDirective(info, idPrefix) {
|
||||
directiveFactory.$inject = [constants_1.NG2_HOST_VIEW_FACTORY_REF_MAP, constants_1.NG2_APP_VIEW_MANAGER, constants_1.NG1_PARSE];
|
||||
function directiveFactory(hostViewFactoryRefMap, viewManager, parse) {
|
||||
var hostViewFactory = hostViewFactoryRefMap[info.selector];
|
||||
if (!hostViewFactory)
|
||||
throw new Error('Expecting HostViewFactoryRef for: ' + info.selector);
|
||||
var idCount = 0;
|
||||
return {
|
||||
restrict: 'E',
|
||||
require: constants_1.REQUIRE_INJECTOR,
|
||||
link: {post: function(scope, element, attrs, parentInjector, transclude) {
|
||||
var domElement = element[0];
|
||||
var facade = new downgrade_ng2_adapter_1.DowngradeNg2ComponentAdapter(idPrefix + (idCount++), info, element, attrs, scope, parentInjector, parse, viewManager, hostViewFactory);
|
||||
facade.setupInputs();
|
||||
facade.bootstrapNg2();
|
||||
facade.projectContent();
|
||||
facade.setupOutputs();
|
||||
facade.registerCleanup();
|
||||
}}
|
||||
};
|
||||
}
|
||||
return directiveFactory;
|
||||
}
|
||||
var UpgradeAdapterRef = (function() {
|
||||
function UpgradeAdapterRef() {
|
||||
this._readyFn = null;
|
||||
this.ng1RootScope = null;
|
||||
this.ng1Injector = null;
|
||||
this.ng2ApplicationRef = null;
|
||||
this.ng2Injector = null;
|
||||
}
|
||||
UpgradeAdapterRef.prototype._bootstrapDone = function(applicationRef, ng1Injector) {
|
||||
this.ng2ApplicationRef = applicationRef;
|
||||
this.ng2Injector = applicationRef.injector;
|
||||
this.ng1Injector = ng1Injector;
|
||||
this.ng1RootScope = ng1Injector.get(constants_1.NG1_ROOT_SCOPE);
|
||||
this._readyFn && this._readyFn(this);
|
||||
};
|
||||
UpgradeAdapterRef.prototype.ready = function(fn) {
|
||||
this._readyFn = fn;
|
||||
};
|
||||
UpgradeAdapterRef.prototype.dispose = function() {
|
||||
this.ng1Injector.get(constants_1.NG1_ROOT_SCOPE).$destroy();
|
||||
this.ng2ApplicationRef.dispose();
|
||||
};
|
||||
return UpgradeAdapterRef;
|
||||
})();
|
||||
exports.UpgradeAdapterRef = UpgradeAdapterRef;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/upgrade", ["angular2/src/upgrade/upgrade_adapter"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var upgrade_adapter_1 = require("angular2/src/upgrade/upgrade_adapter");
|
||||
exports.UpgradeAdapter = upgrade_adapter_1.UpgradeAdapter;
|
||||
exports.UpgradeAdapterRef = upgrade_adapter_1.UpgradeAdapterRef;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
//# sourceMappingURLDisabled=upgrade.dev.js.map
|
|
@ -1,777 +0,0 @@
|
|||
"format register";
|
||||
System.register("angular2/src/upgrade/metadata", ["angular2/core"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var core_1 = require("angular2/core");
|
||||
var COMPONENT_SELECTOR = /^[\w|-]*$/;
|
||||
var SKEWER_CASE = /-(\w)/g;
|
||||
var directiveResolver = new core_1.DirectiveResolver();
|
||||
function getComponentInfo(type) {
|
||||
var resolvedMetadata = directiveResolver.resolve(type);
|
||||
var selector = resolvedMetadata.selector;
|
||||
if (!selector.match(COMPONENT_SELECTOR)) {
|
||||
throw new Error('Only selectors matching element names are supported, got: ' + selector);
|
||||
}
|
||||
var selector = selector.replace(SKEWER_CASE, function(all, letter) {
|
||||
return letter.toUpperCase();
|
||||
});
|
||||
return {
|
||||
type: type,
|
||||
selector: selector,
|
||||
inputs: parseFields(resolvedMetadata.inputs),
|
||||
outputs: parseFields(resolvedMetadata.outputs)
|
||||
};
|
||||
}
|
||||
exports.getComponentInfo = getComponentInfo;
|
||||
function parseFields(names) {
|
||||
var attrProps = [];
|
||||
if (names) {
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
var parts = names[i].split(':');
|
||||
var prop = parts[0].trim();
|
||||
var attr = (parts[1] || parts[0]).trim();
|
||||
var capitalAttr = attr.charAt(0).toUpperCase() + attr.substr(1);
|
||||
attrProps.push({
|
||||
prop: prop,
|
||||
attr: attr,
|
||||
bracketAttr: "[" + attr + "]",
|
||||
parenAttr: "(" + attr + ")",
|
||||
bracketParenAttr: "[(" + attr + ")]",
|
||||
onAttr: "on" + capitalAttr,
|
||||
bindAttr: "bind" + capitalAttr,
|
||||
bindonAttr: "bindon" + capitalAttr
|
||||
});
|
||||
}
|
||||
}
|
||||
return attrProps;
|
||||
}
|
||||
exports.parseFields = parseFields;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/util", [], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
function stringify(obj) {
|
||||
if (typeof obj == 'function')
|
||||
return obj.name || obj.toString();
|
||||
return '' + obj;
|
||||
}
|
||||
exports.stringify = stringify;
|
||||
function onError(e) {
|
||||
console.log(e, e.stack);
|
||||
throw e;
|
||||
}
|
||||
exports.onError = onError;
|
||||
function controllerKey(name) {
|
||||
return '$' + name + 'Controller';
|
||||
}
|
||||
exports.controllerKey = controllerKey;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/constants", [], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
exports.NG2_APP_VIEW_MANAGER = 'ng2.AppViewManager';
|
||||
exports.NG2_COMPILER = 'ng2.Compiler';
|
||||
exports.NG2_INJECTOR = 'ng2.Injector';
|
||||
exports.NG2_HOST_VIEW_FACTORY_REF_MAP = 'ng2.HostViewFactoryRefMap';
|
||||
exports.NG2_ZONE = 'ng2.NgZone';
|
||||
exports.NG1_CONTROLLER = '$controller';
|
||||
exports.NG1_SCOPE = '$scope';
|
||||
exports.NG1_ROOT_SCOPE = '$rootScope';
|
||||
exports.NG1_COMPILE = '$compile';
|
||||
exports.NG1_HTTP_BACKEND = '$httpBackend';
|
||||
exports.NG1_INJECTOR = '$injector';
|
||||
exports.NG1_PARSE = '$parse';
|
||||
exports.NG1_TEMPLATE_CACHE = '$templateCache';
|
||||
exports.REQUIRE_INJECTOR = '^' + exports.NG2_INJECTOR;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/downgrade_ng2_adapter", ["angular2/core", "angular2/src/upgrade/constants"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var core_1 = require("angular2/core");
|
||||
var constants_1 = require("angular2/src/upgrade/constants");
|
||||
var INITIAL_VALUE = {__UNINITIALIZED__: true};
|
||||
var DowngradeNg2ComponentAdapter = (function() {
|
||||
function DowngradeNg2ComponentAdapter(id, info, element, attrs, scope, parentInjector, parse, viewManager, hostViewFactory) {
|
||||
this.id = id;
|
||||
this.info = info;
|
||||
this.element = element;
|
||||
this.attrs = attrs;
|
||||
this.scope = scope;
|
||||
this.parentInjector = parentInjector;
|
||||
this.parse = parse;
|
||||
this.viewManager = viewManager;
|
||||
this.hostViewFactory = hostViewFactory;
|
||||
this.component = null;
|
||||
this.inputChangeCount = 0;
|
||||
this.inputChanges = null;
|
||||
this.hostViewRef = null;
|
||||
this.changeDetector = null;
|
||||
this.contentInsertionPoint = null;
|
||||
this.element[0].id = id;
|
||||
this.componentScope = scope.$new();
|
||||
this.childNodes = element.contents();
|
||||
}
|
||||
DowngradeNg2ComponentAdapter.prototype.bootstrapNg2 = function() {
|
||||
var childInjector = this.parentInjector.resolveAndCreateChild([core_1.provide(constants_1.NG1_SCOPE, {useValue: this.componentScope})]);
|
||||
this.contentInsertionPoint = document.createComment('ng1 insertion point');
|
||||
this.hostViewRef = this.viewManager.createRootHostView(this.hostViewFactory, '#' + this.id, childInjector, [[this.contentInsertionPoint]]);
|
||||
var hostElement = this.viewManager.getHostElement(this.hostViewRef);
|
||||
this.changeDetector = this.hostViewRef.changeDetectorRef;
|
||||
this.component = this.viewManager.getComponent(hostElement);
|
||||
};
|
||||
DowngradeNg2ComponentAdapter.prototype.setupInputs = function() {
|
||||
var _this = this;
|
||||
var attrs = this.attrs;
|
||||
var inputs = this.info.inputs;
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
var input = inputs[i];
|
||||
var expr = null;
|
||||
if (attrs.hasOwnProperty(input.attr)) {
|
||||
var observeFn = (function(prop) {
|
||||
var prevValue = INITIAL_VALUE;
|
||||
return function(value) {
|
||||
if (_this.inputChanges !== null) {
|
||||
_this.inputChangeCount++;
|
||||
_this.inputChanges[prop] = new Ng1Change(value, prevValue === INITIAL_VALUE ? value : prevValue);
|
||||
prevValue = value;
|
||||
}
|
||||
_this.component[prop] = value;
|
||||
};
|
||||
})(input.prop);
|
||||
attrs.$observe(input.attr, observeFn);
|
||||
} else if (attrs.hasOwnProperty(input.bindAttr)) {
|
||||
expr = attrs[input.bindAttr];
|
||||
} else if (attrs.hasOwnProperty(input.bracketAttr)) {
|
||||
expr = attrs[input.bracketAttr];
|
||||
} else if (attrs.hasOwnProperty(input.bindonAttr)) {
|
||||
expr = attrs[input.bindonAttr];
|
||||
} else if (attrs.hasOwnProperty(input.bracketParenAttr)) {
|
||||
expr = attrs[input.bracketParenAttr];
|
||||
}
|
||||
if (expr != null) {
|
||||
var watchFn = (function(prop) {
|
||||
return function(value, prevValue) {
|
||||
if (_this.inputChanges != null) {
|
||||
_this.inputChangeCount++;
|
||||
_this.inputChanges[prop] = new Ng1Change(prevValue, value);
|
||||
}
|
||||
_this.component[prop] = value;
|
||||
};
|
||||
})(input.prop);
|
||||
this.componentScope.$watch(expr, watchFn);
|
||||
}
|
||||
}
|
||||
var prototype = this.info.type.prototype;
|
||||
if (prototype && prototype.ngOnChanges) {
|
||||
this.inputChanges = {};
|
||||
this.componentScope.$watch(function() {
|
||||
return _this.inputChangeCount;
|
||||
}, function() {
|
||||
var inputChanges = _this.inputChanges;
|
||||
_this.inputChanges = {};
|
||||
_this.component.ngOnChanges(inputChanges);
|
||||
});
|
||||
}
|
||||
this.componentScope.$watch(function() {
|
||||
return _this.changeDetector && _this.changeDetector.detectChanges();
|
||||
});
|
||||
};
|
||||
DowngradeNg2ComponentAdapter.prototype.projectContent = function() {
|
||||
var childNodes = this.childNodes;
|
||||
var parent = this.contentInsertionPoint.parentNode;
|
||||
if (parent) {
|
||||
for (var i = 0,
|
||||
ii = childNodes.length; i < ii; i++) {
|
||||
parent.insertBefore(childNodes[i], this.contentInsertionPoint);
|
||||
}
|
||||
}
|
||||
};
|
||||
DowngradeNg2ComponentAdapter.prototype.setupOutputs = function() {
|
||||
var _this = this;
|
||||
var attrs = this.attrs;
|
||||
var outputs = this.info.outputs;
|
||||
for (var j = 0; j < outputs.length; j++) {
|
||||
var output = outputs[j];
|
||||
var expr = null;
|
||||
var assignExpr = false;
|
||||
var bindonAttr = output.bindonAttr ? output.bindonAttr.substring(0, output.bindonAttr.length - 6) : null;
|
||||
var bracketParenAttr = output.bracketParenAttr ? "[(" + output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8) + ")]" : null;
|
||||
if (attrs.hasOwnProperty(output.onAttr)) {
|
||||
expr = attrs[output.onAttr];
|
||||
} else if (attrs.hasOwnProperty(output.parenAttr)) {
|
||||
expr = attrs[output.parenAttr];
|
||||
} else if (attrs.hasOwnProperty(bindonAttr)) {
|
||||
expr = attrs[bindonAttr];
|
||||
assignExpr = true;
|
||||
} else if (attrs.hasOwnProperty(bracketParenAttr)) {
|
||||
expr = attrs[bracketParenAttr];
|
||||
assignExpr = true;
|
||||
}
|
||||
if (expr != null && assignExpr != null) {
|
||||
var getter = this.parse(expr);
|
||||
var setter = getter.assign;
|
||||
if (assignExpr && !setter) {
|
||||
throw new Error("Expression '" + expr + "' is not assignable!");
|
||||
}
|
||||
var emitter = this.component[output.prop];
|
||||
if (emitter) {
|
||||
emitter.subscribe({next: assignExpr ? (function(setter) {
|
||||
return function(value) {
|
||||
return setter(_this.scope, value);
|
||||
};
|
||||
})(setter) : (function(getter) {
|
||||
return function(value) {
|
||||
return getter(_this.scope, {$event: value});
|
||||
};
|
||||
})(getter)});
|
||||
} else {
|
||||
throw new Error("Missing emitter '" + output.prop + "' on component '" + this.info.selector + "'!");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
DowngradeNg2ComponentAdapter.prototype.registerCleanup = function() {
|
||||
var _this = this;
|
||||
this.element.bind('$remove', function() {
|
||||
return _this.viewManager.destroyRootHostView(_this.hostViewRef);
|
||||
});
|
||||
};
|
||||
return DowngradeNg2ComponentAdapter;
|
||||
})();
|
||||
exports.DowngradeNg2ComponentAdapter = DowngradeNg2ComponentAdapter;
|
||||
var Ng1Change = (function() {
|
||||
function Ng1Change(previousValue, currentValue) {
|
||||
this.previousValue = previousValue;
|
||||
this.currentValue = currentValue;
|
||||
}
|
||||
Ng1Change.prototype.isFirstChange = function() {
|
||||
return this.previousValue === this.currentValue;
|
||||
};
|
||||
return Ng1Change;
|
||||
})();
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/angular_js", [], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
function noNg() {
|
||||
throw new Error('AngularJS v1.x is not loaded!');
|
||||
}
|
||||
var angular = {
|
||||
bootstrap: noNg,
|
||||
module: noNg,
|
||||
element: noNg,
|
||||
version: noNg
|
||||
};
|
||||
try {
|
||||
if (window.hasOwnProperty('angular')) {
|
||||
angular = window.angular;
|
||||
}
|
||||
} catch (e) {}
|
||||
exports.bootstrap = angular.bootstrap;
|
||||
exports.module = angular.module;
|
||||
exports.element = angular.element;
|
||||
exports.version = angular.version;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/upgrade_ng1_adapter", ["angular2/core", "angular2/src/upgrade/constants", "angular2/src/upgrade/util", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var core_1 = require("angular2/core");
|
||||
var constants_1 = require("angular2/src/upgrade/constants");
|
||||
var util_1 = require("angular2/src/upgrade/util");
|
||||
var angular = require("angular2/src/upgrade/angular_js");
|
||||
var CAMEL_CASE = /([A-Z])/g;
|
||||
var INITIAL_VALUE = {__UNINITIALIZED__: true};
|
||||
var NOT_SUPPORTED = 'NOT_SUPPORTED';
|
||||
var UpgradeNg1ComponentAdapterBuilder = (function() {
|
||||
function UpgradeNg1ComponentAdapterBuilder(name) {
|
||||
this.name = name;
|
||||
this.inputs = [];
|
||||
this.inputsRename = [];
|
||||
this.outputs = [];
|
||||
this.outputsRename = [];
|
||||
this.propertyOutputs = [];
|
||||
this.checkProperties = [];
|
||||
this.propertyMap = {};
|
||||
this.linkFn = null;
|
||||
this.directive = null;
|
||||
this.$controller = null;
|
||||
var selector = name.replace(CAMEL_CASE, function(all, next) {
|
||||
return '-' + next.toLowerCase();
|
||||
});
|
||||
var self = this;
|
||||
this.type = core_1.Directive({
|
||||
selector: selector,
|
||||
inputs: this.inputsRename,
|
||||
outputs: this.outputsRename
|
||||
}).Class({
|
||||
constructor: [new core_1.Inject(constants_1.NG1_SCOPE), core_1.ElementRef, function(scope, elementRef) {
|
||||
return new UpgradeNg1ComponentAdapter(self.linkFn, scope, self.directive, elementRef, self.$controller, self.inputs, self.outputs, self.propertyOutputs, self.checkProperties, self.propertyMap);
|
||||
}],
|
||||
ngOnChanges: function() {},
|
||||
ngDoCheck: function() {}
|
||||
});
|
||||
}
|
||||
UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective = function(injector) {
|
||||
var directives = injector.get(this.name + 'Directive');
|
||||
if (directives.length > 1) {
|
||||
throw new Error('Only support single directive definition for: ' + this.name);
|
||||
}
|
||||
var directive = directives[0];
|
||||
if (directive.replace)
|
||||
this.notSupported('replace');
|
||||
if (directive.terminal)
|
||||
this.notSupported('terminal');
|
||||
var link = directive.link;
|
||||
if (typeof link == 'object') {
|
||||
if (link.post)
|
||||
this.notSupported('link.post');
|
||||
}
|
||||
return directive;
|
||||
};
|
||||
UpgradeNg1ComponentAdapterBuilder.prototype.notSupported = function(feature) {
|
||||
throw new Error("Upgraded directive '" + this.name + "' does not support '" + feature + "'.");
|
||||
};
|
||||
UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings = function() {
|
||||
var btcIsObject = typeof this.directive.bindToController === 'object';
|
||||
if (btcIsObject && Object.keys(this.directive.scope).length) {
|
||||
throw new Error("Binding definitions on scope and controller at the same time are not supported.");
|
||||
}
|
||||
var context = (btcIsObject) ? this.directive.bindToController : this.directive.scope;
|
||||
if (typeof context == 'object') {
|
||||
for (var name in context) {
|
||||
if (context.hasOwnProperty(name)) {
|
||||
var localName = context[name];
|
||||
var type = localName.charAt(0);
|
||||
localName = localName.substr(1) || name;
|
||||
var outputName = 'output_' + name;
|
||||
var outputNameRename = outputName + ': ' + name;
|
||||
var outputNameRenameChange = outputName + ': ' + name + 'Change';
|
||||
var inputName = 'input_' + name;
|
||||
var inputNameRename = inputName + ': ' + name;
|
||||
switch (type) {
|
||||
case '=':
|
||||
this.propertyOutputs.push(outputName);
|
||||
this.checkProperties.push(localName);
|
||||
this.outputs.push(outputName);
|
||||
this.outputsRename.push(outputNameRenameChange);
|
||||
this.propertyMap[outputName] = localName;
|
||||
case '@':
|
||||
this.inputs.push(inputName);
|
||||
this.inputsRename.push(inputNameRename);
|
||||
this.propertyMap[inputName] = localName;
|
||||
break;
|
||||
case '&':
|
||||
this.outputs.push(outputName);
|
||||
this.outputsRename.push(outputNameRename);
|
||||
this.propertyMap[outputName] = localName;
|
||||
break;
|
||||
default:
|
||||
var json = JSON.stringify(context);
|
||||
throw new Error("Unexpected mapping '" + type + "' in '" + json + "' in '" + this.name + "' directive.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate = function(compile, templateCache, httpBackend) {
|
||||
var _this = this;
|
||||
if (this.directive.template !== undefined) {
|
||||
this.linkFn = compileHtml(this.directive.template);
|
||||
} else if (this.directive.templateUrl) {
|
||||
var url = this.directive.templateUrl;
|
||||
var html = templateCache.get(url);
|
||||
if (html !== undefined) {
|
||||
this.linkFn = compileHtml(html);
|
||||
} else {
|
||||
return new Promise(function(resolve, err) {
|
||||
httpBackend('GET', url, null, function(status, response) {
|
||||
if (status == 200) {
|
||||
resolve(_this.linkFn = compileHtml(templateCache.put(url, response)));
|
||||
} else {
|
||||
err("GET " + url + " returned " + status + ": " + response);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
throw new Error("Directive '" + this.name + "' is not a component, it is missing template.");
|
||||
}
|
||||
return null;
|
||||
function compileHtml(html) {
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = html;
|
||||
return compile(div.childNodes);
|
||||
}
|
||||
};
|
||||
UpgradeNg1ComponentAdapterBuilder.resolve = function(exportedComponents, injector) {
|
||||
var promises = [];
|
||||
var compile = injector.get(constants_1.NG1_COMPILE);
|
||||
var templateCache = injector.get(constants_1.NG1_TEMPLATE_CACHE);
|
||||
var httpBackend = injector.get(constants_1.NG1_HTTP_BACKEND);
|
||||
var $controller = injector.get(constants_1.NG1_CONTROLLER);
|
||||
for (var name in exportedComponents) {
|
||||
if (exportedComponents.hasOwnProperty(name)) {
|
||||
var exportedComponent = exportedComponents[name];
|
||||
exportedComponent.directive = exportedComponent.extractDirective(injector);
|
||||
exportedComponent.$controller = $controller;
|
||||
exportedComponent.extractBindings();
|
||||
var promise = exportedComponent.compileTemplate(compile, templateCache, httpBackend);
|
||||
if (promise)
|
||||
promises.push(promise);
|
||||
}
|
||||
}
|
||||
return Promise.all(promises);
|
||||
};
|
||||
return UpgradeNg1ComponentAdapterBuilder;
|
||||
})();
|
||||
exports.UpgradeNg1ComponentAdapterBuilder = UpgradeNg1ComponentAdapterBuilder;
|
||||
var UpgradeNg1ComponentAdapter = (function() {
|
||||
function UpgradeNg1ComponentAdapter(linkFn, scope, directive, elementRef, $controller, inputs, outputs, propOuts, checkProperties, propertyMap) {
|
||||
this.directive = directive;
|
||||
this.inputs = inputs;
|
||||
this.outputs = outputs;
|
||||
this.propOuts = propOuts;
|
||||
this.checkProperties = checkProperties;
|
||||
this.propertyMap = propertyMap;
|
||||
this.destinationObj = null;
|
||||
this.checkLastValues = [];
|
||||
var element = elementRef.nativeElement;
|
||||
var childNodes = [];
|
||||
var childNode;
|
||||
while (childNode = element.firstChild) {
|
||||
element.removeChild(childNode);
|
||||
childNodes.push(childNode);
|
||||
}
|
||||
var componentScope = scope.$new(!!directive.scope);
|
||||
var $element = angular.element(element);
|
||||
var controllerType = directive.controller;
|
||||
var controller = null;
|
||||
if (controllerType) {
|
||||
var locals = {
|
||||
$scope: componentScope,
|
||||
$element: $element
|
||||
};
|
||||
controller = $controller(controllerType, locals, null, directive.controllerAs);
|
||||
$element.data(util_1.controllerKey(directive.name), controller);
|
||||
}
|
||||
var link = directive.link;
|
||||
if (typeof link == 'object')
|
||||
link = link.pre;
|
||||
if (link) {
|
||||
var attrs = NOT_SUPPORTED;
|
||||
var transcludeFn = NOT_SUPPORTED;
|
||||
var linkController = this.resolveRequired($element, directive.require);
|
||||
directive.link(componentScope, $element, attrs, linkController, transcludeFn);
|
||||
}
|
||||
this.destinationObj = directive.bindToController && controller ? controller : componentScope;
|
||||
linkFn(componentScope, function(clonedElement, scope) {
|
||||
for (var i = 0,
|
||||
ii = clonedElement.length; i < ii; i++) {
|
||||
element.appendChild(clonedElement[i]);
|
||||
}
|
||||
}, {parentBoundTranscludeFn: function(scope, cloneAttach) {
|
||||
cloneAttach(childNodes);
|
||||
}});
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
this[inputs[i]] = null;
|
||||
}
|
||||
for (var j = 0; j < outputs.length; j++) {
|
||||
var emitter = this[outputs[j]] = new core_1.EventEmitter();
|
||||
this.setComponentProperty(outputs[j], (function(emitter) {
|
||||
return function(value) {
|
||||
return emitter.emit(value);
|
||||
};
|
||||
})(emitter));
|
||||
}
|
||||
for (var k = 0; k < propOuts.length; k++) {
|
||||
this[propOuts[k]] = new core_1.EventEmitter();
|
||||
this.checkLastValues.push(INITIAL_VALUE);
|
||||
}
|
||||
}
|
||||
UpgradeNg1ComponentAdapter.prototype.ngOnChanges = function(changes) {
|
||||
for (var name in changes) {
|
||||
if (changes.hasOwnProperty(name)) {
|
||||
var change = changes[name];
|
||||
this.setComponentProperty(name, change.currentValue);
|
||||
}
|
||||
}
|
||||
};
|
||||
UpgradeNg1ComponentAdapter.prototype.ngDoCheck = function() {
|
||||
var count = 0;
|
||||
var destinationObj = this.destinationObj;
|
||||
var lastValues = this.checkLastValues;
|
||||
var checkProperties = this.checkProperties;
|
||||
for (var i = 0; i < checkProperties.length; i++) {
|
||||
var value = destinationObj[checkProperties[i]];
|
||||
var last = lastValues[i];
|
||||
if (value !== last) {
|
||||
if (typeof value == 'number' && isNaN(value) && typeof last == 'number' && isNaN(last)) {} else {
|
||||
var eventEmitter = this[this.propOuts[i]];
|
||||
eventEmitter.emit(lastValues[i] = value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
};
|
||||
UpgradeNg1ComponentAdapter.prototype.setComponentProperty = function(name, value) {
|
||||
this.destinationObj[this.propertyMap[name]] = value;
|
||||
};
|
||||
UpgradeNg1ComponentAdapter.prototype.resolveRequired = function($element, require) {
|
||||
if (!require) {
|
||||
return undefined;
|
||||
} else if (typeof require == 'string') {
|
||||
var name = require;
|
||||
var isOptional = false;
|
||||
var startParent = false;
|
||||
var searchParents = false;
|
||||
var ch;
|
||||
if (name.charAt(0) == '?') {
|
||||
isOptional = true;
|
||||
name = name.substr(1);
|
||||
}
|
||||
if (name.charAt(0) == '^') {
|
||||
searchParents = true;
|
||||
name = name.substr(1);
|
||||
}
|
||||
if (name.charAt(0) == '^') {
|
||||
startParent = true;
|
||||
name = name.substr(1);
|
||||
}
|
||||
var key = util_1.controllerKey(name);
|
||||
if (startParent)
|
||||
$element = $element.parent();
|
||||
var dep = searchParents ? $element.inheritedData(key) : $element.data(key);
|
||||
if (!dep && !isOptional) {
|
||||
throw new Error("Can not locate '" + require + "' in '" + this.directive.name + "'.");
|
||||
}
|
||||
return dep;
|
||||
} else if (require instanceof Array) {
|
||||
var deps = [];
|
||||
for (var i = 0; i < require.length; i++) {
|
||||
deps.push(this.resolveRequired($element, require[i]));
|
||||
}
|
||||
return deps;
|
||||
}
|
||||
throw new Error("Directive '" + this.directive.name + "' require syntax unrecognized: " + this.directive.require);
|
||||
};
|
||||
return UpgradeNg1ComponentAdapter;
|
||||
})();
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/upgrade/upgrade_adapter", ["angular2/core", "angular2/src/facade/async", "angular2/platform/browser", "angular2/src/upgrade/metadata", "angular2/src/upgrade/util", "angular2/src/upgrade/constants", "angular2/src/upgrade/downgrade_ng2_adapter", "angular2/src/upgrade/upgrade_ng1_adapter", "angular2/src/upgrade/angular_js"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var core_1 = require("angular2/core");
|
||||
var async_1 = require("angular2/src/facade/async");
|
||||
var browser_1 = require("angular2/platform/browser");
|
||||
var metadata_1 = require("angular2/src/upgrade/metadata");
|
||||
var util_1 = require("angular2/src/upgrade/util");
|
||||
var constants_1 = require("angular2/src/upgrade/constants");
|
||||
var downgrade_ng2_adapter_1 = require("angular2/src/upgrade/downgrade_ng2_adapter");
|
||||
var upgrade_ng1_adapter_1 = require("angular2/src/upgrade/upgrade_ng1_adapter");
|
||||
var angular = require("angular2/src/upgrade/angular_js");
|
||||
var upgradeCount = 0;
|
||||
var UpgradeAdapter = (function() {
|
||||
function UpgradeAdapter() {
|
||||
this.idPrefix = "NG2_UPGRADE_" + upgradeCount++ + "_";
|
||||
this.upgradedComponents = [];
|
||||
this.downgradedComponents = {};
|
||||
this.providers = [];
|
||||
}
|
||||
UpgradeAdapter.prototype.downgradeNg2Component = function(type) {
|
||||
this.upgradedComponents.push(type);
|
||||
var info = metadata_1.getComponentInfo(type);
|
||||
return ng1ComponentDirective(info, "" + this.idPrefix + info.selector + "_c");
|
||||
};
|
||||
UpgradeAdapter.prototype.upgradeNg1Component = function(name) {
|
||||
if (this.downgradedComponents.hasOwnProperty(name)) {
|
||||
return this.downgradedComponents[name].type;
|
||||
} else {
|
||||
return (this.downgradedComponents[name] = new upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder(name)).type;
|
||||
}
|
||||
};
|
||||
UpgradeAdapter.prototype.bootstrap = function(element, modules, config) {
|
||||
var _this = this;
|
||||
var upgrade = new UpgradeAdapterRef();
|
||||
var ng1Injector = null;
|
||||
var platformRef = core_1.platform(browser_1.BROWSER_PROVIDERS);
|
||||
var applicationRef = platformRef.application([browser_1.BROWSER_APP_PROVIDERS, core_1.provide(constants_1.NG1_INJECTOR, {useFactory: function() {
|
||||
return ng1Injector;
|
||||
}}), core_1.provide(constants_1.NG1_COMPILE, {useFactory: function() {
|
||||
return ng1Injector.get(constants_1.NG1_COMPILE);
|
||||
}}), this.providers]);
|
||||
var injector = applicationRef.injector;
|
||||
var ngZone = injector.get(core_1.NgZone);
|
||||
var compiler = injector.get(core_1.Compiler);
|
||||
var delayApplyExps = [];
|
||||
var original$applyFn;
|
||||
var rootScopePrototype;
|
||||
var rootScope;
|
||||
var hostViewFactoryRefMap = {};
|
||||
var ng1Module = angular.module(this.idPrefix, modules);
|
||||
var ng1compilePromise = null;
|
||||
ng1Module.value(constants_1.NG2_INJECTOR, injector).value(constants_1.NG2_ZONE, ngZone).value(constants_1.NG2_COMPILER, compiler).value(constants_1.NG2_HOST_VIEW_FACTORY_REF_MAP, hostViewFactoryRefMap).value(constants_1.NG2_APP_VIEW_MANAGER, injector.get(core_1.AppViewManager)).config(['$provide', function(provide) {
|
||||
provide.decorator(constants_1.NG1_ROOT_SCOPE, ['$delegate', function(rootScopeDelegate) {
|
||||
rootScopePrototype = rootScopeDelegate.constructor.prototype;
|
||||
if (rootScopePrototype.hasOwnProperty('$apply')) {
|
||||
original$applyFn = rootScopePrototype.$apply;
|
||||
rootScopePrototype.$apply = function(exp) {
|
||||
return delayApplyExps.push(exp);
|
||||
};
|
||||
} else {
|
||||
throw new Error("Failed to find '$apply' on '$rootScope'!");
|
||||
}
|
||||
return rootScope = rootScopeDelegate;
|
||||
}]);
|
||||
}]).run(['$injector', '$rootScope', function(injector, rootScope) {
|
||||
ng1Injector = injector;
|
||||
async_1.ObservableWrapper.subscribe(ngZone.onTurnDone, function(_) {
|
||||
ngZone.run(function() {
|
||||
return rootScope.$apply();
|
||||
});
|
||||
});
|
||||
ng1compilePromise = upgrade_ng1_adapter_1.UpgradeNg1ComponentAdapterBuilder.resolve(_this.downgradedComponents, injector);
|
||||
}]);
|
||||
angular.element(element).data(util_1.controllerKey(constants_1.NG2_INJECTOR), injector);
|
||||
ngZone.run(function() {
|
||||
angular.bootstrap(element, [_this.idPrefix], config);
|
||||
});
|
||||
Promise.all([this.compileNg2Components(compiler, hostViewFactoryRefMap), ng1compilePromise]).then(function() {
|
||||
ngZone.run(function() {
|
||||
if (rootScopePrototype) {
|
||||
rootScopePrototype.$apply = original$applyFn;
|
||||
while (delayApplyExps.length) {
|
||||
rootScope.$apply(delayApplyExps.shift());
|
||||
}
|
||||
upgrade._bootstrapDone(applicationRef, ng1Injector);
|
||||
rootScopePrototype = null;
|
||||
}
|
||||
});
|
||||
}, util_1.onError);
|
||||
return upgrade;
|
||||
};
|
||||
UpgradeAdapter.prototype.addProvider = function(provider) {
|
||||
this.providers.push(provider);
|
||||
};
|
||||
UpgradeAdapter.prototype.upgradeNg1Provider = function(name, options) {
|
||||
var token = options && options.asToken || name;
|
||||
this.providers.push(core_1.provide(token, {
|
||||
useFactory: function(ng1Injector) {
|
||||
return ng1Injector.get(name);
|
||||
},
|
||||
deps: [constants_1.NG1_INJECTOR]
|
||||
}));
|
||||
};
|
||||
UpgradeAdapter.prototype.downgradeNg2Provider = function(token) {
|
||||
var factory = function(injector) {
|
||||
return injector.get(token);
|
||||
};
|
||||
factory.$inject = [constants_1.NG2_INJECTOR];
|
||||
return factory;
|
||||
};
|
||||
UpgradeAdapter.prototype.compileNg2Components = function(compiler, hostViewFactoryRefMap) {
|
||||
var _this = this;
|
||||
var promises = [];
|
||||
var types = this.upgradedComponents;
|
||||
for (var i = 0; i < types.length; i++) {
|
||||
promises.push(compiler.compileInHost(types[i]));
|
||||
}
|
||||
return Promise.all(promises).then(function(hostViewFactories) {
|
||||
var types = _this.upgradedComponents;
|
||||
for (var i = 0; i < hostViewFactories.length; i++) {
|
||||
hostViewFactoryRefMap[metadata_1.getComponentInfo(types[i]).selector] = hostViewFactories[i];
|
||||
}
|
||||
return hostViewFactoryRefMap;
|
||||
}, util_1.onError);
|
||||
};
|
||||
return UpgradeAdapter;
|
||||
})();
|
||||
exports.UpgradeAdapter = UpgradeAdapter;
|
||||
function ng1ComponentDirective(info, idPrefix) {
|
||||
directiveFactory.$inject = [constants_1.NG2_HOST_VIEW_FACTORY_REF_MAP, constants_1.NG2_APP_VIEW_MANAGER, constants_1.NG1_PARSE];
|
||||
function directiveFactory(hostViewFactoryRefMap, viewManager, parse) {
|
||||
var hostViewFactory = hostViewFactoryRefMap[info.selector];
|
||||
if (!hostViewFactory)
|
||||
throw new Error('Expecting HostViewFactoryRef for: ' + info.selector);
|
||||
var idCount = 0;
|
||||
return {
|
||||
restrict: 'E',
|
||||
require: constants_1.REQUIRE_INJECTOR,
|
||||
link: {post: function(scope, element, attrs, parentInjector, transclude) {
|
||||
var domElement = element[0];
|
||||
var facade = new downgrade_ng2_adapter_1.DowngradeNg2ComponentAdapter(idPrefix + (idCount++), info, element, attrs, scope, parentInjector, parse, viewManager, hostViewFactory);
|
||||
facade.setupInputs();
|
||||
facade.bootstrapNg2();
|
||||
facade.projectContent();
|
||||
facade.setupOutputs();
|
||||
facade.registerCleanup();
|
||||
}}
|
||||
};
|
||||
}
|
||||
return directiveFactory;
|
||||
}
|
||||
var UpgradeAdapterRef = (function() {
|
||||
function UpgradeAdapterRef() {
|
||||
this._readyFn = null;
|
||||
this.ng1RootScope = null;
|
||||
this.ng1Injector = null;
|
||||
this.ng2ApplicationRef = null;
|
||||
this.ng2Injector = null;
|
||||
}
|
||||
UpgradeAdapterRef.prototype._bootstrapDone = function(applicationRef, ng1Injector) {
|
||||
this.ng2ApplicationRef = applicationRef;
|
||||
this.ng2Injector = applicationRef.injector;
|
||||
this.ng1Injector = ng1Injector;
|
||||
this.ng1RootScope = ng1Injector.get(constants_1.NG1_ROOT_SCOPE);
|
||||
this._readyFn && this._readyFn(this);
|
||||
};
|
||||
UpgradeAdapterRef.prototype.ready = function(fn) {
|
||||
this._readyFn = fn;
|
||||
};
|
||||
UpgradeAdapterRef.prototype.dispose = function() {
|
||||
this.ng1Injector.get(constants_1.NG1_ROOT_SCOPE).$destroy();
|
||||
this.ng2ApplicationRef.dispose();
|
||||
};
|
||||
return UpgradeAdapterRef;
|
||||
})();
|
||||
exports.UpgradeAdapterRef = UpgradeAdapterRef;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/upgrade", ["angular2/src/upgrade/upgrade_adapter"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var upgrade_adapter_1 = require("angular2/src/upgrade/upgrade_adapter");
|
||||
exports.UpgradeAdapter = upgrade_adapter_1.UpgradeAdapter;
|
||||
exports.UpgradeAdapterRef = upgrade_adapter_1.UpgradeAdapterRef;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
//# sourceMappingURLDisabled=upgrade.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,4 +0,0 @@
|
|||
export * from './src/common/pipes';
|
||||
export * from './src/common/directives';
|
||||
export * from './src/common/forms';
|
||||
export * from './src/common/common_directives';
|
|
@ -1,8 +0,0 @@
|
|||
'use strict';function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
__export(require('./src/common/pipes'));
|
||||
__export(require('./src/common/directives'));
|
||||
__export(require('./src/common/forms'));
|
||||
__export(require('./src/common/common_directives'));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYW5ndWxhcjIvY29tbW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlCQUFjLG9CQUFvQixDQUFDLEVBQUE7QUFDbkMsaUJBQWMseUJBQXlCLENBQUMsRUFBQTtBQUN4QyxpQkFBYyxvQkFBb0IsQ0FBQyxFQUFBO0FBQ25DLGlCQUFjLGdDQUFnQyxDQUFDLEVBQUEiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3NyYy9jb21tb24vcGlwZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29tbW9uL2RpcmVjdGl2ZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29tbW9uL2Zvcm1zJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvbW1vbi9jb21tb25fZGlyZWN0aXZlcyc7Il19
|
|
@ -1,8 +0,0 @@
|
|||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Starting point to import all compiler APIs.
|
||||
*/
|
||||
export * from './src/compiler/url_resolver';
|
||||
export * from './src/compiler/xhr';
|
||||
export * from './src/compiler/compiler';
|
|
@ -1,12 +0,0 @@
|
|||
'use strict';function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Starting point to import all compiler APIs.
|
||||
*/
|
||||
__export(require('./src/compiler/url_resolver'));
|
||||
__export(require('./src/compiler/xhr'));
|
||||
__export(require('./src/compiler/compiler'));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJhbmd1bGFyMi9jb21waWxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQTs7OztHQUlHO0FBQ0gsaUJBQWMsNkJBQTZCLENBQUMsRUFBQTtBQUM1QyxpQkFBYyxvQkFBb0IsQ0FBQyxFQUFBO0FBQ25DLGlCQUFjLHlCQUF5QixDQUFDLEVBQUEiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBtb2R1bGVcbiAqIEBkZXNjcmlwdGlvblxuICogU3RhcnRpbmcgcG9pbnQgdG8gaW1wb3J0IGFsbCBjb21waWxlciBBUElzLlxuICovXG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb21waWxlci91cmxfcmVzb2x2ZXInO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29tcGlsZXIveGhyJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvbXBpbGVyL2NvbXBpbGVyJzsiXX0=
|
|
@ -1,24 +0,0 @@
|
|||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Starting point to import all public core APIs.
|
||||
*/
|
||||
export * from './src/core/metadata';
|
||||
export * from './src/core/util';
|
||||
export * from './src/core/prod_mode';
|
||||
export * from './src/core/di';
|
||||
export * from './src/facade/facade';
|
||||
export { enableProdMode } from 'angular2/src/facade/lang';
|
||||
export { platform, createNgZone, PlatformRef, ApplicationRef } from './src/core/application_ref';
|
||||
export { APP_ID, APP_COMPONENT, APP_INITIALIZER, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER } from './src/core/application_tokens';
|
||||
export * from './src/core/zone';
|
||||
export * from './src/core/render';
|
||||
export * from './src/core/linker';
|
||||
export { DebugElement, DebugNode, asNativeElements } from './src/core/debug/debug_node';
|
||||
export * from './src/core/testability/testability';
|
||||
export * from './src/core/change_detection';
|
||||
export * from './src/core/platform_directives_and_pipes';
|
||||
export * from './src/core/platform_common_providers';
|
||||
export * from './src/core/application_common_providers';
|
||||
export * from './src/core/reflection/reflection';
|
||||
import "./manual_typings/globals-es6.d.ts";
|
|
@ -1,40 +0,0 @@
|
|||
'use strict';function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Starting point to import all public core APIs.
|
||||
*/
|
||||
__export(require('./src/core/metadata'));
|
||||
__export(require('./src/core/util'));
|
||||
__export(require('./src/core/prod_mode'));
|
||||
__export(require('./src/core/di'));
|
||||
__export(require('./src/facade/facade'));
|
||||
var lang_1 = require('angular2/src/facade/lang');
|
||||
exports.enableProdMode = lang_1.enableProdMode;
|
||||
var application_ref_1 = require('./src/core/application_ref');
|
||||
exports.platform = application_ref_1.platform;
|
||||
exports.createNgZone = application_ref_1.createNgZone;
|
||||
exports.PlatformRef = application_ref_1.PlatformRef;
|
||||
exports.ApplicationRef = application_ref_1.ApplicationRef;
|
||||
var application_tokens_1 = require('./src/core/application_tokens');
|
||||
exports.APP_ID = application_tokens_1.APP_ID;
|
||||
exports.APP_COMPONENT = application_tokens_1.APP_COMPONENT;
|
||||
exports.APP_INITIALIZER = application_tokens_1.APP_INITIALIZER;
|
||||
exports.PACKAGE_ROOT_URL = application_tokens_1.PACKAGE_ROOT_URL;
|
||||
exports.PLATFORM_INITIALIZER = application_tokens_1.PLATFORM_INITIALIZER;
|
||||
__export(require('./src/core/zone'));
|
||||
__export(require('./src/core/render'));
|
||||
__export(require('./src/core/linker'));
|
||||
var debug_node_1 = require('./src/core/debug/debug_node');
|
||||
exports.DebugElement = debug_node_1.DebugElement;
|
||||
exports.DebugNode = debug_node_1.DebugNode;
|
||||
exports.asNativeElements = debug_node_1.asNativeElements;
|
||||
__export(require('./src/core/testability/testability'));
|
||||
__export(require('./src/core/change_detection'));
|
||||
__export(require('./src/core/platform_directives_and_pipes'));
|
||||
__export(require('./src/core/platform_common_providers'));
|
||||
__export(require('./src/core/application_common_providers'));
|
||||
__export(require('./src/core/reflection/reflection'));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImFuZ3VsYXIyL2NvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUE7Ozs7R0FJRztBQUNILGlCQUFjLHFCQUFxQixDQUFDLEVBQUE7QUFDcEMsaUJBQWMsaUJBQWlCLENBQUMsRUFBQTtBQUNoQyxpQkFBYyxzQkFBc0IsQ0FBQyxFQUFBO0FBQ3JDLGlCQUFjLGVBQWUsQ0FBQyxFQUFBO0FBQzlCLGlCQUFjLHFCQUFxQixDQUFDLEVBQUE7QUFDcEMscUJBQTZCLDBCQUEwQixDQUFDO0FBQWhELCtDQUFnRDtBQUN4RCxnQ0FBa0UsNEJBQTRCLENBQUM7QUFBdkYsOENBQVE7QUFBRSxzREFBWTtBQUFFLG9EQUFXO0FBQUUsMERBQWtEO0FBQy9GLG1DQU1PLCtCQUErQixDQUFDO0FBTHJDLDZDQUFNO0FBQ04sMkRBQWE7QUFDYiwrREFBZTtBQUNmLGlFQUFnQjtBQUNoQix5RUFDcUM7QUFDdkMsaUJBQWMsaUJBQWlCLENBQUMsRUFBQTtBQUNoQyxpQkFBYyxtQkFBbUIsQ0FBQyxFQUFBO0FBQ2xDLGlCQUFjLG1CQUFtQixDQUFDLEVBQUE7QUFDbEMsMkJBQXdELDZCQUE2QixDQUFDO0FBQTlFLGlEQUFZO0FBQUUsMkNBQVM7QUFBRSx5REFBcUQ7QUFDdEYsaUJBQWMsb0NBQW9DLENBQUMsRUFBQTtBQUNuRCxpQkFBYyw2QkFBNkIsQ0FBQyxFQUFBO0FBQzVDLGlCQUFjLDBDQUEwQyxDQUFDLEVBQUE7QUFDekQsaUJBQWMsc0NBQXNDLENBQUMsRUFBQTtBQUNyRCxpQkFBYyx5Q0FBeUMsQ0FBQyxFQUFBO0FBQ3hELGlCQUFjLGtDQUFrQyxDQUFDLEVBQUEiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBtb2R1bGVcbiAqIEBkZXNjcmlwdGlvblxuICogU3RhcnRpbmcgcG9pbnQgdG8gaW1wb3J0IGFsbCBwdWJsaWMgY29yZSBBUElzLlxuICovXG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb3JlL21ldGFkYXRhJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvcmUvdXRpbCc7XG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb3JlL3Byb2RfbW9kZSc7XG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb3JlL2RpJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2ZhY2FkZS9mYWNhZGUnO1xuZXhwb3J0IHtlbmFibGVQcm9kTW9kZX0gZnJvbSAnYW5ndWxhcjIvc3JjL2ZhY2FkZS9sYW5nJztcbmV4cG9ydCB7cGxhdGZvcm0sIGNyZWF0ZU5nWm9uZSwgUGxhdGZvcm1SZWYsIEFwcGxpY2F0aW9uUmVmfSBmcm9tICcuL3NyYy9jb3JlL2FwcGxpY2F0aW9uX3JlZic7XG5leHBvcnQge1xuICBBUFBfSUQsXG4gIEFQUF9DT01QT05FTlQsXG4gIEFQUF9JTklUSUFMSVpFUixcbiAgUEFDS0FHRV9ST09UX1VSTCxcbiAgUExBVEZPUk1fSU5JVElBTElaRVJcbn0gZnJvbSAnLi9zcmMvY29yZS9hcHBsaWNhdGlvbl90b2tlbnMnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29yZS96b25lJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvcmUvcmVuZGVyJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvcmUvbGlua2VyJztcbmV4cG9ydCB7RGVidWdFbGVtZW50LCBEZWJ1Z05vZGUsIGFzTmF0aXZlRWxlbWVudHN9IGZyb20gJy4vc3JjL2NvcmUvZGVidWcvZGVidWdfbm9kZSc7XG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb3JlL3Rlc3RhYmlsaXR5L3Rlc3RhYmlsaXR5JztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvcmUvY2hhbmdlX2RldGVjdGlvbic7XG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb3JlL3BsYXRmb3JtX2RpcmVjdGl2ZXNfYW5kX3BpcGVzJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvcmUvcGxhdGZvcm1fY29tbW9uX3Byb3ZpZGVycyc7XG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb3JlL2FwcGxpY2F0aW9uX2NvbW1vbl9wcm92aWRlcnMnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29yZS9yZWZsZWN0aW9uL3JlZmxlY3Rpb24nO1xuIl19
|
|
@ -1,6 +0,0 @@
|
|||
Angular2
|
||||
=========
|
||||
|
||||
The sources for this package are in the main [Angular2](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo. This is the repository for the upcoming 2.0 version. If you're looking for the current official version of Angular you should go to [angular/angular.js](https://github.com/angular/angular.js)
|
||||
|
||||
License: Apache MIT 2.0
|
|
@ -1,15 +0,0 @@
|
|||
Angular2
|
||||
=========
|
||||
|
||||
The sources for this package are in the main [Angular2](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo. This is the repository for the upcoming 2.0 version. If you're looking for the current official version of Angular you should go to [angular/angular.js](https://github.com/angular/angular.js)
|
||||
|
||||
This package contains different sources for different users:
|
||||
|
||||
1. The files located in the root folder can be consumed using CommonJS.
|
||||
2. The files under `/es6` are es6 compatible files that can be transpiled to
|
||||
es5 using any transpiler. This contains:
|
||||
* `dev/`: a development version that includes runtime type assertions
|
||||
* `prod/`: a production version that does not include runtime type assertions
|
||||
3. The files under `/ts` are the TypeScript source files.
|
||||
|
||||
License: Apache MIT 2.0
|
|
@ -1,6 +0,0 @@
|
|||
export { Animation } from './src/animate/animation';
|
||||
export { AnimationBuilder } from './src/animate/animation_builder';
|
||||
export { BrowserDetails } from './src/animate/browser_details';
|
||||
export { CssAnimationBuilder } from './src/animate/css_animation_builder';
|
||||
export { CssAnimationOptions } from './src/animate/css_animation_options';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5pbWF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImFuZ3VsYXIyL2FuaW1hdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsU0FBUSxTQUFTLFFBQU8seUJBQXlCLENBQUM7QUFDbEQsU0FBUSxnQkFBZ0IsUUFBTyxpQ0FBaUMsQ0FBQztBQUNqRSxTQUFRLGNBQWMsUUFBTywrQkFBK0IsQ0FBQztBQUM3RCxTQUFRLG1CQUFtQixRQUFPLHFDQUFxQyxDQUFDO0FBQ3hFLFNBQVEsbUJBQW1CLFFBQU8scUNBQXFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQge0FuaW1hdGlvbn0gZnJvbSAnLi9zcmMvYW5pbWF0ZS9hbmltYXRpb24nO1xuZXhwb3J0IHtBbmltYXRpb25CdWlsZGVyfSBmcm9tICcuL3NyYy9hbmltYXRlL2FuaW1hdGlvbl9idWlsZGVyJztcbmV4cG9ydCB7QnJvd3NlckRldGFpbHN9IGZyb20gJy4vc3JjL2FuaW1hdGUvYnJvd3Nlcl9kZXRhaWxzJztcbmV4cG9ydCB7Q3NzQW5pbWF0aW9uQnVpbGRlcn0gZnJvbSAnLi9zcmMvYW5pbWF0ZS9jc3NfYW5pbWF0aW9uX2J1aWxkZXInO1xuZXhwb3J0IHtDc3NBbmltYXRpb25PcHRpb25zfSBmcm9tICcuL3NyYy9hbmltYXRlL2Nzc19hbmltYXRpb25fb3B0aW9ucyc7XG4iXX0=
|
|
@ -1,2 +0,0 @@
|
|||
export * from 'angular2/src/mock/animation_builder_mock';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdGluZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImFuZ3VsYXIyL2FuaW1hdGUvdGVzdGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDBDQUEwQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnYW5ndWxhcjIvc3JjL21vY2svYW5pbWF0aW9uX2J1aWxkZXJfbW9jayc7XG4iXX0=
|
|
@ -1,7 +0,0 @@
|
|||
/**
|
||||
* See {@link bootstrap} for more information.
|
||||
* @deprecated
|
||||
*/
|
||||
export { bootstrap } from 'angular2/platform/browser';
|
||||
export { AngularEntrypoint } from 'angular2/src/core/angular_entrypoint';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9vdHN0cmFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYW5ndWxhcjIvYm9vdHN0cmFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUNILFNBQVEsU0FBUyxRQUFPLDJCQUEyQixDQUFDO0FBQ3BELFNBQVEsaUJBQWlCLFFBQU8sc0NBQXNDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFNlZSB7QGxpbmsgYm9vdHN0cmFwfSBmb3IgbW9yZSBpbmZvcm1hdGlvbi5cbiAqIEBkZXByZWNhdGVkXG4gKi9cbmV4cG9ydCB7Ym9vdHN0cmFwfSBmcm9tICdhbmd1bGFyMi9wbGF0Zm9ybS9icm93c2VyJztcbmV4cG9ydCB7QW5ndWxhckVudHJ5cG9pbnR9IGZyb20gJ2FuZ3VsYXIyL3NyYy9jb3JlL2FuZ3VsYXJfZW50cnlwb2ludCc7XG4iXX0=
|
|
@ -1,7 +0,0 @@
|
|||
/**
|
||||
* See {@link bootstrap} for more information.
|
||||
* @deprecated
|
||||
*/
|
||||
export { bootstrapStatic } from 'angular2/platform/browser_static';
|
||||
export { AngularEntrypoint } from 'angular2/src/core/angular_entrypoint';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9vdHN0cmFwX3N0YXRpYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImFuZ3VsYXIyL2Jvb3RzdHJhcF9zdGF0aWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7OztHQUdHO0FBQ0gsU0FBUSxlQUFlLFFBQU8sa0NBQWtDLENBQUM7QUFDakUsU0FBUSxpQkFBaUIsUUFBTyxzQ0FBc0MsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogU2VlIHtAbGluayBib290c3RyYXB9IGZvciBtb3JlIGluZm9ybWF0aW9uLlxuICogQGRlcHJlY2F0ZWRcbiAqL1xuZXhwb3J0IHtib290c3RyYXBTdGF0aWN9IGZyb20gJ2FuZ3VsYXIyL3BsYXRmb3JtL2Jyb3dzZXJfc3RhdGljJztcbmV4cG9ydCB7QW5ndWxhckVudHJ5cG9pbnR9IGZyb20gJ2FuZ3VsYXIyL3NyYy9jb3JlL2FuZ3VsYXJfZW50cnlwb2ludCc7XG4iXX0=
|
|
@ -1,5 +0,0 @@
|
|||
export * from './src/common/pipes';
|
||||
export * from './src/common/directives';
|
||||
export * from './src/common/forms';
|
||||
export * from './src/common/common_directives';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYW5ndWxhcjIvY29tbW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsZ0NBQWdDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3NyYy9jb21tb24vcGlwZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29tbW9uL2RpcmVjdGl2ZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29tbW9uL2Zvcm1zJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvbW1vbi9jb21tb25fZGlyZWN0aXZlcyc7Il19
|
|
@ -1,9 +0,0 @@
|
|||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Starting point to import all compiler APIs.
|
||||
*/
|
||||
export * from './src/compiler/url_resolver';
|
||||
export * from './src/compiler/xhr';
|
||||
export * from './src/compiler/compiler';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJhbmd1bGFyMi9jb21waWxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7OztHQUlHO0FBQ0gsY0FBYyw2QkFBNkIsQ0FBQztBQUM1QyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMseUJBQXlCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBtb2R1bGVcbiAqIEBkZXNjcmlwdGlvblxuICogU3RhcnRpbmcgcG9pbnQgdG8gaW1wb3J0IGFsbCBjb21waWxlciBBUElzLlxuICovXG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb21waWxlci91cmxfcmVzb2x2ZXInO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29tcGlsZXIveGhyJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvbXBpbGVyL2NvbXBpbGVyJzsiXX0=
|
|
@ -1,24 +0,0 @@
|
|||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Starting point to import all public core APIs.
|
||||
*/
|
||||
export * from './src/core/metadata';
|
||||
export * from './src/core/util';
|
||||
export * from './src/core/prod_mode';
|
||||
export * from './src/core/di';
|
||||
export * from './src/facade/facade';
|
||||
export { enableProdMode } from 'angular2/src/facade/lang';
|
||||
export { platform, createNgZone, PlatformRef, ApplicationRef } from './src/core/application_ref';
|
||||
export { APP_ID, APP_COMPONENT, APP_INITIALIZER, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER } from './src/core/application_tokens';
|
||||
export * from './src/core/zone';
|
||||
export * from './src/core/render';
|
||||
export * from './src/core/linker';
|
||||
export { DebugElement, DebugNode, asNativeElements } from './src/core/debug/debug_node';
|
||||
export * from './src/core/testability/testability';
|
||||
export * from './src/core/change_detection';
|
||||
export * from './src/core/platform_directives_and_pipes';
|
||||
export * from './src/core/platform_common_providers';
|
||||
export * from './src/core/application_common_providers';
|
||||
export * from './src/core/reflection/reflection';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImFuZ3VsYXIyL2NvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7R0FJRztBQUNILGNBQWMscUJBQXFCLENBQUM7QUFDcEMsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsU0FBUSxjQUFjLFFBQU8sMEJBQTBCLENBQUM7QUFDeEQsU0FBUSxRQUFRLEVBQUUsWUFBWSxFQUFFLFdBQVcsRUFBRSxjQUFjLFFBQU8sNEJBQTRCLENBQUM7QUFDL0YsU0FDRSxNQUFNLEVBQ04sYUFBYSxFQUNiLGVBQWUsRUFDZixnQkFBZ0IsRUFDaEIsb0JBQW9CLFFBQ2YsK0JBQStCLENBQUM7QUFDdkMsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsbUJBQW1CLENBQUM7QUFDbEMsU0FBUSxZQUFZLEVBQUUsU0FBUyxFQUFFLGdCQUFnQixRQUFPLDZCQUE2QixDQUFDO0FBQ3RGLGNBQWMsb0NBQW9DLENBQUM7QUFDbkQsY0FBYyw2QkFBNkIsQ0FBQztBQUM1QyxjQUFjLDBDQUEwQyxDQUFDO0FBQ3pELGNBQWMsc0NBQXNDLENBQUM7QUFDckQsY0FBYyx5Q0FBeUMsQ0FBQztBQUN4RCxjQUFjLGtDQUFrQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbW9kdWxlXG4gKiBAZGVzY3JpcHRpb25cbiAqIFN0YXJ0aW5nIHBvaW50IHRvIGltcG9ydCBhbGwgcHVibGljIGNvcmUgQVBJcy5cbiAqL1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29yZS9tZXRhZGF0YSc7XG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb3JlL3V0aWwnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29yZS9wcm9kX21vZGUnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29yZS9kaSc7XG5leHBvcnQgKiBmcm9tICcuL3NyYy9mYWNhZGUvZmFjYWRlJztcbmV4cG9ydCB7ZW5hYmxlUHJvZE1vZGV9IGZyb20gJ2FuZ3VsYXIyL3NyYy9mYWNhZGUvbGFuZyc7XG5leHBvcnQge3BsYXRmb3JtLCBjcmVhdGVOZ1pvbmUsIFBsYXRmb3JtUmVmLCBBcHBsaWNhdGlvblJlZn0gZnJvbSAnLi9zcmMvY29yZS9hcHBsaWNhdGlvbl9yZWYnO1xuZXhwb3J0IHtcbiAgQVBQX0lELFxuICBBUFBfQ09NUE9ORU5ULFxuICBBUFBfSU5JVElBTElaRVIsXG4gIFBBQ0tBR0VfUk9PVF9VUkwsXG4gIFBMQVRGT1JNX0lOSVRJQUxJWkVSXG59IGZyb20gJy4vc3JjL2NvcmUvYXBwbGljYXRpb25fdG9rZW5zJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvcmUvem9uZSc7XG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb3JlL3JlbmRlcic7XG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb3JlL2xpbmtlcic7XG5leHBvcnQge0RlYnVnRWxlbWVudCwgRGVidWdOb2RlLCBhc05hdGl2ZUVsZW1lbnRzfSBmcm9tICcuL3NyYy9jb3JlL2RlYnVnL2RlYnVnX25vZGUnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29yZS90ZXN0YWJpbGl0eS90ZXN0YWJpbGl0eSc7XG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb3JlL2NoYW5nZV9kZXRlY3Rpb24nO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29yZS9wbGF0Zm9ybV9kaXJlY3RpdmVzX2FuZF9waXBlcyc7XG5leHBvcnQgKiBmcm9tICcuL3NyYy9jb3JlL3BsYXRmb3JtX2NvbW1vbl9wcm92aWRlcnMnO1xuZXhwb3J0ICogZnJvbSAnLi9zcmMvY29yZS9hcHBsaWNhdGlvbl9jb21tb25fcHJvdmlkZXJzJztcbmV4cG9ydCAqIGZyb20gJy4vc3JjL2NvcmUvcmVmbGVjdGlvbi9yZWZsZWN0aW9uJztcbiJdfQ==
|
|
@ -1,6 +0,0 @@
|
|||
# API Examples
|
||||
|
||||
This folder contains small example apps that get in-lined into our API docs.
|
||||
These examples are written with idiomatic TypeScript, and are not transpiled to Dart.
|
||||
Each example contains tests for application behavior (as opposed to testing Angular's
|
||||
behavior) just like an Angular application developer would write.
|
|
@ -1,44 +0,0 @@
|
|||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
import { Component } from 'angular2/core';
|
||||
import { MinLengthValidator, MaxLengthValidator } from 'angular2/common';
|
||||
// #docregion min
|
||||
let MinLengthTestComponent = class {
|
||||
};
|
||||
MinLengthTestComponent = __decorate([
|
||||
Component({
|
||||
selector: 'min-cmp',
|
||||
directives: [MinLengthValidator],
|
||||
template: `
|
||||
<form>
|
||||
<p>Year: <input ngControl="year" minlength="2"></p>
|
||||
</form>
|
||||
`
|
||||
}),
|
||||
__metadata('design:paramtypes', [])
|
||||
], MinLengthTestComponent);
|
||||
// #enddocregion
|
||||
// #docregion max
|
||||
let MaxLengthTestComponent = class {
|
||||
};
|
||||
MaxLengthTestComponent = __decorate([
|
||||
Component({
|
||||
selector: 'max-cmp',
|
||||
directives: [MaxLengthValidator],
|
||||
template: `
|
||||
<form>
|
||||
<p>Year: <input ngControl="year" maxlength="4"></p>
|
||||
</form>
|
||||
`
|
||||
}),
|
||||
__metadata('design:paramtypes', [])
|
||||
], MaxLengthTestComponent);
|
||||
// #enddocregion
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImFuZ3VsYXIyL2V4YW1wbGVzL2NvbW1vbi9mb3Jtcy90cy92YWxpZGF0b3JzL3ZhbGlkYXRvcnMudHMiXSwibmFtZXMiOlsiTWluTGVuZ3RoVGVzdENvbXBvbmVudCIsIk1heExlbmd0aFRlc3RDb21wb25lbnQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztPQUFPLEVBQUMsU0FBUyxFQUFDLE1BQU0sZUFBZTtPQUNoQyxFQUFDLGtCQUFrQixFQUFFLGtCQUFrQixFQUFDLE1BQU0saUJBQWlCO0FBRXRFLGlCQUFpQjtBQUNqQjtBQVVBQSxDQUFDQTtBQVZEO0lBQUMsU0FBUyxDQUFDO1FBQ1QsUUFBUSxFQUFFLFNBQVM7UUFDbkIsVUFBVSxFQUFFLENBQUMsa0JBQWtCLENBQUM7UUFDaEMsUUFBUSxFQUFFOzs7O0NBSVg7S0FDQSxDQUFDOzsyQkFFRDtBQUNELGdCQUFnQjtBQUVoQixpQkFBaUI7QUFDakI7QUFVQUMsQ0FBQ0E7QUFWRDtJQUFDLFNBQVMsQ0FBQztRQUNULFFBQVEsRUFBRSxTQUFTO1FBQ25CLFVBQVUsRUFBRSxDQUFDLGtCQUFrQixDQUFDO1FBQ2hDLFFBQVEsRUFBRTs7OztDQUlYO0tBQ0EsQ0FBQzs7MkJBRUQ7QUFDRCxnQkFBZ0IiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge0NvbXBvbmVudH0gZnJvbSAnYW5ndWxhcjIvY29yZSc7XG5pbXBvcnQge01pbkxlbmd0aFZhbGlkYXRvciwgTWF4TGVuZ3RoVmFsaWRhdG9yfSBmcm9tICdhbmd1bGFyMi9jb21tb24nO1xuXG4vLyAjZG9jcmVnaW9uIG1pblxuQENvbXBvbmVudCh7XG4gIHNlbGVjdG9yOiAnbWluLWNtcCcsXG4gIGRpcmVjdGl2ZXM6IFtNaW5MZW5ndGhWYWxpZGF0b3JdLFxuICB0ZW1wbGF0ZTogYFxuPGZvcm0+XG4gIDxwPlllYXI6IDxpbnB1dCBuZ0NvbnRyb2w9XCJ5ZWFyXCIgbWlubGVuZ3RoPVwiMlwiPjwvcD5cbjwvZm9ybT5cbmBcbn0pXG5jbGFzcyBNaW5MZW5ndGhUZXN0Q29tcG9uZW50IHtcbn1cbi8vICNlbmRkb2NyZWdpb25cblxuLy8gI2RvY3JlZ2lvbiBtYXhcbkBDb21wb25lbnQoe1xuICBzZWxlY3RvcjogJ21heC1jbXAnLFxuICBkaXJlY3RpdmVzOiBbTWF4TGVuZ3RoVmFsaWRhdG9yXSxcbiAgdGVtcGxhdGU6IGBcbjxmb3JtPlxuICA8cD5ZZWFyOiA8aW5wdXQgbmdDb250cm9sPVwieWVhclwiIG1heGxlbmd0aD1cIjRcIj48L3A+XG48L2Zvcm0+XG5gXG59KVxuY2xhc3MgTWF4TGVuZ3RoVGVzdENvbXBvbmVudCB7XG59XG4vLyAjZW5kZG9jcmVnaW9uXG4iXX0=
|
|
@ -1,17 +0,0 @@
|
|||
import { provide } from 'angular2/core';
|
||||
import { bootstrap } from 'angular2/bootstrap';
|
||||
import { UrlResolver } from 'angular2/compiler';
|
||||
var MyApp;
|
||||
// #docregion url_resolver
|
||||
class MyUrlResolver extends UrlResolver {
|
||||
resolve(baseUrl, url) {
|
||||
// Serve CSS files from a special CDN.
|
||||
if (url.substr(-4) === '.css') {
|
||||
return super.resolve('http://cdn.myapp.com/css/', url);
|
||||
}
|
||||
return super.resolve(baseUrl, url);
|
||||
}
|
||||
}
|
||||
bootstrap(MyApp, [provide(UrlResolver, { useClass: MyUrlResolver })]);
|
||||
// #enddocregion
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXJsX3Jlc29sdmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYW5ndWxhcjIvZXhhbXBsZXMvY29tcGlsZXIvdHMvdXJsX3Jlc29sdmVyL3VybF9yZXNvbHZlci50cyJdLCJuYW1lcyI6WyJNeVVybFJlc29sdmVyIiwiTXlVcmxSZXNvbHZlci5yZXNvbHZlIl0sIm1hcHBpbmdzIjoiT0FBTyxFQUFDLE9BQU8sRUFBQyxNQUFNLGVBQWU7T0FDOUIsRUFBQyxTQUFTLEVBQUMsTUFBTSxvQkFBb0I7T0FDckMsRUFBQyxXQUFXLEVBQUMsTUFBTSxtQkFBbUI7QUFFN0MsSUFBSSxLQUFLLENBQUM7QUFFViwwQkFBMEI7QUFDMUIsNEJBQTRCLFdBQVc7SUFDckNBLE9BQU9BLENBQUNBLE9BQWVBLEVBQUVBLEdBQVdBO1FBQ2xDQyxzQ0FBc0NBO1FBQ3RDQSxFQUFFQSxDQUFDQSxDQUFDQSxHQUFHQSxDQUFDQSxNQUFNQSxDQUFDQSxDQUFDQSxDQUFDQSxDQUFDQSxLQUFLQSxNQUFNQSxDQUFDQSxDQUFDQSxDQUFDQTtZQUM5QkEsTUFBTUEsQ0FBQ0EsS0FBS0EsQ0FBQ0EsT0FBT0EsQ0FBQ0EsMkJBQTJCQSxFQUFFQSxHQUFHQSxDQUFDQSxDQUFDQTtRQUN6REEsQ0FBQ0E7UUFDREEsTUFBTUEsQ0FBQ0EsS0FBS0EsQ0FBQ0EsT0FBT0EsQ0FBQ0EsT0FBT0EsRUFBRUEsR0FBR0EsQ0FBQ0EsQ0FBQ0E7SUFDckNBLENBQUNBO0FBQ0hELENBQUNBO0FBRUQsU0FBUyxDQUFDLEtBQUssRUFBRSxDQUFDLE9BQU8sQ0FBQyxXQUFXLEVBQUUsRUFBQyxRQUFRLEVBQUUsYUFBYSxFQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDcEUsZ0JBQWdCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtwcm92aWRlfSBmcm9tICdhbmd1bGFyMi9jb3JlJztcbmltcG9ydCB7Ym9vdHN0cmFwfSBmcm9tICdhbmd1bGFyMi9ib290c3RyYXAnO1xuaW1wb3J0IHtVcmxSZXNvbHZlcn0gZnJvbSAnYW5ndWxhcjIvY29tcGlsZXInO1xuXG52YXIgTXlBcHA7XG5cbi8vICNkb2NyZWdpb24gdXJsX3Jlc29sdmVyXG5jbGFzcyBNeVVybFJlc29sdmVyIGV4dGVuZHMgVXJsUmVzb2x2ZXIge1xuICByZXNvbHZlKGJhc2VVcmw6IHN0cmluZywgdXJsOiBzdHJpbmcpOiBzdHJpbmcge1xuICAgIC8vIFNlcnZlIENTUyBmaWxlcyBmcm9tIGEgc3BlY2lhbCBDRE4uXG4gICAgaWYgKHVybC5zdWJzdHIoLTQpID09PSAnLmNzcycpIHtcbiAgICAgIHJldHVybiBzdXBlci5yZXNvbHZlKCdodHRwOi8vY2RuLm15YXBwLmNvbS9jc3MvJywgdXJsKTtcbiAgICB9XG4gICAgcmV0dXJuIHN1cGVyLnJlc29sdmUoYmFzZVVybCwgdXJsKTtcbiAgfVxufVxuXG5ib290c3RyYXAoTXlBcHAsIFtwcm92aWRlKFVybFJlc29sdmVyLCB7dXNlQ2xhc3M6IE15VXJsUmVzb2x2ZXJ9KV0pO1xuLy8gI2VuZGRvY3JlZ2lvblxuIl19
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue