angular2 test
This commit is contained in:
1 parent
04ff97cd72
commit
ca84ef38f8
6153 files changed
+175102
-595107
No files matched your search
+11
-22
@@ -33,7 +33,7 @@
|
||||
"grunt-ng-annotate": "^0.9.2",
|
||||
"grunt-string-replace": "~0.2.4",
|
||||
"grunt-tslint": "^2.5.0",
|
||||
"grunt-typescript": "^0.7.0",
|
||||
"grunt-typescript": "^0.8.0",
|
||||
"grunt-usemin": "3.0.0",
|
||||
"jshint-stylish": "~0.1.5",
|
||||
"karma": "~0.12.31",
|
||||
@@ -50,7 +50,14 @@
|
||||
"mocha": "2.2.4",
|
||||
"requirejs": "2.1.17",
|
||||
"rjs-build-analysis": "0.0.3",
|
||||
"tslint": "^2.5.0-beta"
|
||||
"tslint": "^2.5.0-beta",
|
||||
"angular2": "2.0.0-beta.0",
|
||||
"systemjs": "0.19.6",
|
||||
"es6-promise": "^3.0.2",
|
||||
"es6-shim": "^0.33.3",
|
||||
"reflect-metadata": "0.1.2",
|
||||
"rxjs": "5.0.0-beta.0",
|
||||
"zone.js": "0.5.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": "0.4.x",
|
||||
@@ -66,25 +73,7 @@
|
||||
"grunt-sync": "^0.4.1",
|
||||
"karma-sinon": "^1.0.3",
|
||||
"lodash": "^2.4.1",
|
||||
"sinon": "1.16.1"
|
||||
},
|
||||
"jspm": {
|
||||
"directories": {
|
||||
"packages": "public/vendor/jspm",
|
||||
"src": "public"
|
||||
},
|
||||
"configFile": "public/app/jspm.conf.js",
|
||||
"dependencies": {
|
||||
"angular": "github:angular/bower-angular@^1.4.5",
|
||||
"angular-route": "github:angular/bower-angular-route@^1.4.5",
|
||||
"angular-sanitize": "github:angular/bower-angular-sanitize@^1.4.5",
|
||||
"angular2": "npm:angular2@^2.0.0-alpha.54",
|
||||
"es6-promise": "npm:es6-promise@^3.0.2",
|
||||
"es6-shim": "npm:es6-shim@^0.33.13",
|
||||
"jquery": "github:components/jquery@^2.1.4",
|
||||
"lodash": "npm:lodash@^3.10.1",
|
||||
"moment": "github:moment/moment@^2.10.6"
|
||||
},
|
||||
"devDependencies": {}
|
||||
"sinon": "1.16.1",
|
||||
"typescript": "^1.7.5"
|
||||
}
|
||||
}
|
||||
+10
-11
@@ -1,16 +1,15 @@
|
||||
///<reference path="headers/common.d.ts" />
|
||||
|
||||
///<amd-dependency path="bootstrap" />
|
||||
///<amd-dependency path="angular-strap" />
|
||||
///<amd-dependency path="angular-route" />
|
||||
///<amd-dependency path="angular-sanitize" />
|
||||
///<amd-dependency path="angular-dragdrop" />
|
||||
///<amd-dependency path="angular-bindonce" />
|
||||
///<amd-dependency path="angular-ui" />
|
||||
///<amd-dependency path="app/core/core" />
|
||||
|
||||
import 'es6-shim';
|
||||
import 'es6-promise';
|
||||
import 'bootstrap';
|
||||
import 'angular-strap';
|
||||
import 'angular-route';
|
||||
import 'angular-sanitize';
|
||||
import 'angular-dragdrop';
|
||||
import 'angular-bindonce';
|
||||
import 'angular-ui';
|
||||
import 'app/core/core';
|
||||
|
||||
import _ = require('lodash');
|
||||
import $ = require('jquery');
|
||||
@@ -88,14 +87,14 @@ class GrafanaApp {
|
||||
this.preBootModules = null;
|
||||
});
|
||||
}).catch(function(err) {
|
||||
console.log('Application boot failed: ' + err);
|
||||
console.log('Application boot failed:', err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var grafanaApp = new GrafanaApp();
|
||||
|
||||
export = {
|
||||
export default {
|
||||
init: function() {
|
||||
grafanaApp.init();
|
||||
},
|
||||
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
declare module "app/core/controllers/all" {
|
||||
let json: any;
|
||||
export {json};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// import grafanaCtrl from './grafana_ctrl';
|
||||
//
|
||||
// import * as asd from './sidemenu_ctrl';
|
||||
//
|
||||
// export {grafanaCtrl};
|
||||
|
||||
define([
|
||||
'./grafana_ctrl',
|
||||
'./search_ctrl',
|
||||
'./inspect_ctrl',
|
||||
'./json_editor_ctrl',
|
||||
'./login_ctrl',
|
||||
'./invited_ctrl',
|
||||
'./signup_ctrl',
|
||||
'./reset_password_ctrl',
|
||||
'./sidemenu_ctrl',
|
||||
'./error_ctrl',
|
||||
], function () {});
|
||||
@@ -1,15 +0,0 @@
|
||||
import grafanaCtrl from './grafana_ctrl';
|
||||
export {grafanaCtrl};
|
||||
|
||||
// define([
|
||||
// './grafana_ctrl',
|
||||
// './search_ctrl',
|
||||
// './inspect_ctrl',
|
||||
// './json_editor_ctrl',
|
||||
// './login_ctrl',
|
||||
// './invited_ctrl',
|
||||
// './signup_ctrl',
|
||||
// './reset_password_ctrl',
|
||||
// './sidemenu_ctrl',
|
||||
// './error_ctrl',
|
||||
// ], function () {});
|
||||
@@ -5,7 +5,7 @@ define([
|
||||
function (angular, coreModule) {
|
||||
'use strict';
|
||||
|
||||
coreModule.controller('ErrorCtrl', function($scope, contextSrv) {
|
||||
coreModule.default.controller('ErrorCtrl', function($scope, contextSrv) {
|
||||
|
||||
var showSideMenu = contextSrv.sidemenu;
|
||||
contextSrv.sidemenu = false;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import angular = require('angular');
|
||||
import _ = require('lodash');
|
||||
import config = require('app/core/config');
|
||||
import store = require('app/core/store');
|
||||
import coreModule from '../core_module';
|
||||
|
||||
@@ -7,7 +7,7 @@ define([
|
||||
function (angular, _, $, coreModule) {
|
||||
'use strict';
|
||||
|
||||
coreModule.controller('InspectCtrl', function($scope) {
|
||||
coreModule.default.controller('InspectCtrl', function($scope) {
|
||||
var model = $scope.inspector;
|
||||
|
||||
function getParametersFromQueryString(queryString) {
|
||||
|
||||
@@ -6,7 +6,7 @@ define([
|
||||
function (angular, coreModule, config) {
|
||||
'use strict';
|
||||
|
||||
coreModule.controller('InvitedCtrl', function($scope, $routeParams, contextSrv, backendSrv) {
|
||||
coreModule.default.controller('InvitedCtrl', function($scope, $routeParams, contextSrv, backendSrv) {
|
||||
contextSrv.sidemenu = false;
|
||||
$scope.formModel = {};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ define([
|
||||
function (angular, coreModule) {
|
||||
'use strict';
|
||||
|
||||
coreModule.controller('JsonEditorCtrl', function($scope) {
|
||||
coreModule.default.controller('JsonEditorCtrl', function($scope) {
|
||||
|
||||
$scope.json = angular.toJson($scope.object, true);
|
||||
$scope.canUpdate = $scope.updateHandler !== void 0;
|
||||
|
||||
@@ -6,7 +6,7 @@ define([
|
||||
function (angular, coreModule, config) {
|
||||
'use strict';
|
||||
|
||||
coreModule.controller('LoginCtrl', function($scope, backendSrv, contextSrv, $location) {
|
||||
coreModule.default.controller('LoginCtrl', function($scope, backendSrv, contextSrv, $location) {
|
||||
$scope.formModel = {
|
||||
user: '',
|
||||
email: '',
|
||||
|
||||
@@ -5,7 +5,7 @@ define([
|
||||
function (angular, coreModule) {
|
||||
'use strict';
|
||||
|
||||
coreModule.controller('ResetPasswordCtrl', function($scope, contextSrv, backendSrv, $location) {
|
||||
coreModule.default.controller('ResetPasswordCtrl', function($scope, contextSrv, backendSrv, $location) {
|
||||
contextSrv.sidemenu = false;
|
||||
$scope.formModel = {};
|
||||
$scope.mode = 'send';
|
||||
|
||||
@@ -7,7 +7,7 @@ define([
|
||||
function (angular, _, coreModule, config) {
|
||||
'use strict';
|
||||
|
||||
coreModule.controller('SearchCtrl', function($scope, $location, $timeout, backendSrv) {
|
||||
coreModule.default.controller('SearchCtrl', function($scope, $location, $timeout, backendSrv) {
|
||||
|
||||
$scope.init = function() {
|
||||
$scope.giveSearchFocus = 0;
|
||||
|
||||
@@ -8,7 +8,7 @@ define([
|
||||
function (angular, _, $, coreModule, config) {
|
||||
'use strict';
|
||||
|
||||
coreModule.controller('SideMenuCtrl', function($scope, $location, contextSrv, backendSrv) {
|
||||
coreModule.default.controller('SideMenuCtrl', function($scope, $location, contextSrv, backendSrv) {
|
||||
|
||||
$scope.getUrl = function(url) {
|
||||
return config.appSubUrl + url;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import angular = require('angular');
|
||||
import config = require('app/core/config');
|
||||
import coreModule = require('../core_module');
|
||||
import coreModule from '../core_module';
|
||||
|
||||
export class SignUpCtrl {
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
///<reference path="../headers/common.d.ts" />
|
||||
|
||||
///<amd-dependency path="./directives/annotation_tooltip" />
|
||||
///<amd-dependency path="./directives/body_class" />
|
||||
///<amd-dependency path="./directives/config_modal" />
|
||||
@@ -14,20 +16,19 @@
|
||||
///<amd-dependency path="./directives/tags" />
|
||||
///<amd-dependency path="./directives/topnav" />
|
||||
///<amd-dependency path="./directives/value_select_dropdown" />
|
||||
///<amd-dependency path="./routes/all" />
|
||||
|
||||
///<amd-dependency path="./controllers/all" />
|
||||
///<amd-dependency path="./services/all" />
|
||||
///<amd-dependency path="./jquery_extended" />
|
||||
///<amd-dependency path="./partials" />
|
||||
|
||||
import {arrayJoin} from './directives/array_join';
|
||||
import * as test from './controllers/all';
|
||||
import * as controllers from 'app/core/controllers/all';
|
||||
import * as services from 'app/core/services/all';
|
||||
import * as routes from 'app/core/routes/all';
|
||||
|
||||
// export * from './directives/give_focus'
|
||||
// export * from './filters/filters'
|
||||
//
|
||||
// import {Component} from 'angular2/angular2';
|
||||
import {Component} from 'angular2/core';
|
||||
console.log(Component);
|
||||
// console.log(Component);
|
||||
|
||||
export {arrayJoin, test};
|
||||
export {arrayJoin, controllers, services, routes};
|
||||
@@ -1,7 +1,7 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import angular = require('angular');
|
||||
import coreModule = require('../core_module');
|
||||
import coreModule from '../core_module';
|
||||
|
||||
coreModule.directive('giveFocus', function() {
|
||||
return function(scope, element, attrs) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import angular = require('angular');
|
||||
import jquery = require('jquery');
|
||||
import moment = require('moment');
|
||||
import _ = require('lodash');
|
||||
import coreModule = require('../core_module');
|
||||
import coreModule from '../core_module';
|
||||
|
||||
coreModule.filter('stringSort', function() {
|
||||
return function(input) {
|
||||
@@ -71,4 +71,4 @@ coreModule.filter('interpolateTemplateVars', function (templateSrv) {
|
||||
return filterFunc;
|
||||
});
|
||||
|
||||
export {};
|
||||
export default {};
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
declare module "app/core/controllers/all" {
|
||||
let json: any;
|
||||
export default json;
|
||||
}
|
||||
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
declare module "app/core/routes/all" {
|
||||
let json: any;
|
||||
export {json};
|
||||
}
|
||||
|
||||
@@ -6,11 +6,10 @@ define([
|
||||
], function(angular, coreModule, BundleLoader) {
|
||||
"use strict";
|
||||
|
||||
coreModule.config(function($routeProvider, $locationProvider) {
|
||||
coreModule.default.config(function($routeProvider, $locationProvider) {
|
||||
$locationProvider.html5Mode(true);
|
||||
|
||||
var loadOrgBundle = new BundleLoader.BundleLoader('app/features/org/all');
|
||||
console.log('routing');
|
||||
|
||||
$routeProvider
|
||||
.when('/', {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
///<reference path="../../headers/require/require.d.ts" />
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
export class BundleLoader {
|
||||
lazy: any;
|
||||
@@ -12,7 +13,7 @@ export class BundleLoader {
|
||||
|
||||
this.loadingDefer = $q.defer();
|
||||
|
||||
require([bundleName], () => {
|
||||
System.import(bundleName).then(() => {
|
||||
this.loadingDefer.resolve();
|
||||
});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ define([
|
||||
function (coreModule) {
|
||||
"use strict";
|
||||
|
||||
coreModule.controller('LoadDashboardCtrl', function($scope, $routeParams, dashboardLoaderSrv, backendSrv) {
|
||||
coreModule.default.controller('LoadDashboardCtrl', function($scope, $routeParams, dashboardLoaderSrv, backendSrv) {
|
||||
|
||||
if (!$routeParams.slug) {
|
||||
backendSrv.get('/api/dashboards/home').then(function(result) {
|
||||
@@ -21,7 +21,7 @@ function (coreModule) {
|
||||
|
||||
});
|
||||
|
||||
coreModule.controller('DashFromImportCtrl', function($scope, $location, alertSrv) {
|
||||
coreModule.default.controller('DashFromImportCtrl', function($scope, $location, alertSrv) {
|
||||
if (!window.grafanaImportDashboard) {
|
||||
alertSrv.set('Not found', 'Cannot reload page with unsaved imported dashboard', 'warning', 7000);
|
||||
$location.path('');
|
||||
@@ -33,7 +33,7 @@ function (coreModule) {
|
||||
}, $scope);
|
||||
});
|
||||
|
||||
coreModule.controller('NewDashboardCtrl', function($scope) {
|
||||
coreModule.default.controller('NewDashboardCtrl', function($scope) {
|
||||
$scope.initDashboard({
|
||||
meta: { canStar: false, canShare: false },
|
||||
dashboard: {
|
||||
|
||||
@@ -6,7 +6,7 @@ define([
|
||||
function (angular, _, coreModule) {
|
||||
'use strict';
|
||||
|
||||
coreModule.service('alertSrv', function($timeout, $sce, $rootScope, $modal, $q) {
|
||||
coreModule.default.service('alertSrv', function($timeout, $sce, $rootScope, $modal, $q) {
|
||||
var self = this;
|
||||
|
||||
this.init = function() {
|
||||
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
declare module "app/core/services/all" {
|
||||
let json: any;
|
||||
export default json;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ define([
|
||||
function(angular, coreModule) {
|
||||
'use strict';
|
||||
|
||||
coreModule.service('googleAnalyticsSrv', function($rootScope, $location) {
|
||||
coreModule.default.service('googleAnalyticsSrv', function($rootScope, $location) {
|
||||
var first = true;
|
||||
|
||||
this.init = function() {
|
||||
|
||||
@@ -7,7 +7,7 @@ define([
|
||||
function (angular, _, coreModule, config) {
|
||||
'use strict';
|
||||
|
||||
coreModule.service('backendSrv', function($http, alertSrv, $timeout) {
|
||||
coreModule.default.service('backendSrv', function($http, alertSrv, $timeout) {
|
||||
var self = this;
|
||||
|
||||
this.get = function(url, params) {
|
||||
|
||||
@@ -8,7 +8,7 @@ define([
|
||||
function (angular, _, coreModule, store, config) {
|
||||
'use strict';
|
||||
|
||||
coreModule.service('contextSrv', function($rootScope, $timeout) {
|
||||
coreModule.default.service('contextSrv', function($rootScope, $timeout) {
|
||||
var self = this;
|
||||
|
||||
function User() {
|
||||
|
||||
@@ -7,7 +7,7 @@ define([
|
||||
function (angular, _, coreModule, config) {
|
||||
'use strict';
|
||||
|
||||
coreModule.service('datasourceSrv', function($q, $injector, $rootScope) {
|
||||
coreModule.default.service('datasourceSrv', function($q, $injector) {
|
||||
var self = this;
|
||||
|
||||
this.init = function() {
|
||||
|
||||
@@ -8,7 +8,7 @@ function (angular, _, coreModule) {
|
||||
|
||||
// This service was based on OpenJS library available in BSD License
|
||||
// http://www.openjs.com/scripts/events/keyboard_shortcuts/index.php
|
||||
coreModule.factory('keyboardManager', ['$window', '$timeout', function ($window, $timeout) {
|
||||
coreModule.default.factory('keyboardManager', ['$window', '$timeout', function ($window, $timeout) {
|
||||
var keyboardManagerService = {};
|
||||
|
||||
var defaultOpt = {
|
||||
|
||||
@@ -7,7 +7,7 @@ define([
|
||||
function (angular, _, $, coreModule) {
|
||||
'use strict';
|
||||
|
||||
coreModule.service('popoverSrv', function($templateCache, $timeout, $q, $http, $compile) {
|
||||
coreModule.default.service('popoverSrv', function($templateCache, $timeout, $q, $http, $compile) {
|
||||
|
||||
this.getTemplate = function(url) {
|
||||
return $q.when($templateCache.get(url) || $http.get(url, {cache: true}));
|
||||
|
||||
@@ -6,7 +6,7 @@ define([
|
||||
function (angular, _, coreModule) {
|
||||
'use strict';
|
||||
|
||||
coreModule.service('uiSegmentSrv', function($sce, templateSrv) {
|
||||
coreModule.default.service('uiSegmentSrv', function($sce, templateSrv) {
|
||||
var self = this;
|
||||
|
||||
function MetricSegment(options) {
|
||||
|
||||
@@ -6,7 +6,7 @@ define([
|
||||
function (angular, _, coreModule) {
|
||||
'use strict';
|
||||
|
||||
coreModule.service('timer', function($timeout) {
|
||||
coreModule.default.service('timer', function($timeout) {
|
||||
// This service really just tracks a list of $timeout promises to give us a
|
||||
// method for cancelling them all when we need to
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ define([
|
||||
function (angular, coreModule) {
|
||||
'use strict';
|
||||
|
||||
coreModule.service('utilSrv', function($rootScope, $modal, $q) {
|
||||
coreModule.default.service('utilSrv', function($rootScope, $modal, $q) {
|
||||
|
||||
this.init = function() {
|
||||
$rootScope.onAppEvent('show-modal', this.showModal, $rootScope);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
class TableModel {
|
||||
export default class TableModel {
|
||||
columns: any[];
|
||||
rows: any[];
|
||||
type: string;
|
||||
@@ -35,5 +35,3 @@ class TableModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export = TableModel;
|
||||
@@ -18,7 +18,7 @@ function translateFillOption(fill) {
|
||||
return fill === 0 ? 0.001 : fill/10;
|
||||
}
|
||||
|
||||
class TimeSeries {
|
||||
export default class TimeSeries {
|
||||
datapoints: any;
|
||||
id: string;
|
||||
label: string;
|
||||
@@ -168,5 +168,3 @@ class TimeSeries {
|
||||
return this.valueFormater(value, this.decimals, this.scaledDecimals);
|
||||
}
|
||||
}
|
||||
|
||||
export = TimeSeries;
|
||||
@@ -10,7 +10,7 @@ var unitsAsc = _.sortBy(units, function (unit) {
|
||||
|
||||
var unitsDesc = unitsAsc.reverse();
|
||||
|
||||
function parse(text, roundUp?) {
|
||||
export function parse(text, roundUp?) {
|
||||
if (!text) { return undefined; }
|
||||
if (moment.isMoment(text)) { return text; }
|
||||
if (_.isDate(text)) { return moment(text); }
|
||||
@@ -43,7 +43,7 @@ function parse(text, roundUp?) {
|
||||
return parseDateMath(mathString, time, roundUp);
|
||||
}
|
||||
|
||||
function isValid(text) {
|
||||
export function isValid(text) {
|
||||
var date = parse(text);
|
||||
if (!date) {
|
||||
return false;
|
||||
@@ -56,7 +56,7 @@ function isValid(text) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function parseDateMath(mathString, time, roundUp?) {
|
||||
export function parseDateMath(mathString, time, roundUp?) {
|
||||
var dateTime = time;
|
||||
var i = 0;
|
||||
var len = mathString.length;
|
||||
@@ -118,8 +118,3 @@ function parseDateMath(mathString, time, roundUp?) {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
export = {
|
||||
parse: parse,
|
||||
parseDateMath: parseDateMath,
|
||||
isValid: isValid
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) 2014, Hugh Kennedy
|
||||
// Based on code from https://github.com/hughsk/flat/blob/master/index.js
|
||||
//
|
||||
function flatten(target, opts): any {
|
||||
export default function flatten(target, opts): any {
|
||||
opts = opts || {};
|
||||
|
||||
var delimiter = opts.delimiter || '.';
|
||||
@@ -35,5 +35,3 @@ function flatten(target, opts): any {
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
export = flatten;
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
import moment = require('moment');
|
||||
import _ = require('lodash');
|
||||
import dateMath = require('app/core/utils/datemath');
|
||||
import angular = require('angular');
|
||||
import * as dateMath from 'app/core/utils/datemath';
|
||||
|
||||
var spans = {
|
||||
's': {display: 'second'},
|
||||
@@ -56,95 +56,89 @@ _.each(rangeOptions, function (frame) {
|
||||
rangeIndex[frame.from + ' to ' + frame.to] = frame;
|
||||
});
|
||||
|
||||
function getRelativeTimesList(timepickerSettings, currentDisplay) {
|
||||
var groups = _.groupBy(rangeOptions, (option: any) => {
|
||||
option.active = option.display === currentDisplay;
|
||||
return option.section;
|
||||
});
|
||||
export function getRelativeTimesList(timepickerSettings, currentDisplay) {
|
||||
var groups = _.groupBy(rangeOptions, (option: any) => {
|
||||
option.active = option.display === currentDisplay;
|
||||
return option.section;
|
||||
});
|
||||
|
||||
// _.each(timepickerSettings.time_options, (duration: string) => {
|
||||
// let info = describeTextRange(duration);
|
||||
// if (info.section) {
|
||||
// groups[info.section].push(info);
|
||||
// }
|
||||
// });
|
||||
// _.each(timepickerSettings.time_options, (duration: string) => {
|
||||
// let info = describeTextRange(duration);
|
||||
// if (info.section) {
|
||||
// groups[info.section].push(info);
|
||||
// }
|
||||
// });
|
||||
|
||||
return groups;
|
||||
return groups;
|
||||
}
|
||||
|
||||
function formatDate(date) {
|
||||
return date.format(absoluteFormat);
|
||||
}
|
||||
|
||||
// handles expressions like
|
||||
// 5m
|
||||
// 5m to now/d
|
||||
// now/d to now
|
||||
// now/d
|
||||
// if no to <expr> then to now is assumed
|
||||
export function describeTextRange(expr: any) {
|
||||
if (expr.indexOf('now') === -1) {
|
||||
expr = 'now-' + expr;
|
||||
}
|
||||
|
||||
function formatDate(date) {
|
||||
return date.format(absoluteFormat);
|
||||
}
|
||||
|
||||
// handles expressions like
|
||||
// 5m
|
||||
// 5m to now/d
|
||||
// now/d to now
|
||||
// now/d
|
||||
// if no to <expr> then to now is assumed
|
||||
function describeTextRange(expr: any) {
|
||||
if (expr.indexOf('now') === -1) {
|
||||
expr = 'now-' + expr;
|
||||
}
|
||||
|
||||
let opt = rangeIndex[expr + ' to now'];
|
||||
if (opt) {
|
||||
return opt;
|
||||
}
|
||||
|
||||
opt = {from: expr, to: 'now'};
|
||||
|
||||
let parts = /^now-(\d+)(\w)/.exec(expr);
|
||||
if (parts) {
|
||||
let unit = parts[2];
|
||||
let amount = parseInt(parts[1]);
|
||||
let span = spans[unit];
|
||||
if (span) {
|
||||
opt.display = 'Last ' + amount + ' ' + span.display;
|
||||
opt.section = span.section;
|
||||
if (amount > 1) {
|
||||
opt.display += 's';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
opt.display = opt.from + ' to ' + opt.to;
|
||||
opt.invalid = true;
|
||||
}
|
||||
|
||||
let opt = rangeIndex[expr + ' to now'];
|
||||
if (opt) {
|
||||
return opt;
|
||||
}
|
||||
|
||||
function describeTimeRange(range) {
|
||||
var option = rangeIndex[range.from.toString() + ' to ' + range.to.toString()];
|
||||
if (option) {
|
||||
return option.display;
|
||||
}
|
||||
opt = {from: expr, to: 'now'};
|
||||
|
||||
if (moment.isMoment(range.from) && moment.isMoment(range.to)) {
|
||||
return formatDate(range.from) + ' to ' + formatDate(range.to);
|
||||
let parts = /^now-(\d+)(\w)/.exec(expr);
|
||||
if (parts) {
|
||||
let unit = parts[2];
|
||||
let amount = parseInt(parts[1]);
|
||||
let span = spans[unit];
|
||||
if (span) {
|
||||
opt.display = 'Last ' + amount + ' ' + span.display;
|
||||
opt.section = span.section;
|
||||
if (amount > 1) {
|
||||
opt.display += 's';
|
||||
}
|
||||
}
|
||||
|
||||
if (moment.isMoment(range.from)) {
|
||||
var toMoment = dateMath.parse(range.to, true);
|
||||
return formatDate(range.from) + ' to ' + toMoment.fromNow();
|
||||
}
|
||||
|
||||
if (moment.isMoment(range.to)) {
|
||||
var from = dateMath.parse(range.from, false);
|
||||
return from.fromNow() + ' to ' + formatDate(range.to);
|
||||
}
|
||||
|
||||
if (range.to.toString() === 'now') {
|
||||
var res = describeTextRange(range.from);
|
||||
return res.display;
|
||||
}
|
||||
|
||||
return range.from.toString() + ' to ' + range.to.toString();
|
||||
} else {
|
||||
opt.display = opt.from + ' to ' + opt.to;
|
||||
opt.invalid = true;
|
||||
}
|
||||
|
||||
export = {
|
||||
getRelativeTimesList: getRelativeTimesList,
|
||||
describeTextRange: describeTextRange,
|
||||
describeTimeRange: describeTimeRange,
|
||||
return opt;
|
||||
}
|
||||
|
||||
export function describeTimeRange(range) {
|
||||
var option = rangeIndex[range.from.toString() + ' to ' + range.to.toString()];
|
||||
if (option) {
|
||||
return option.display;
|
||||
}
|
||||
|
||||
if (moment.isMoment(range.from) && moment.isMoment(range.to)) {
|
||||
return formatDate(range.from) + ' to ' + formatDate(range.to);
|
||||
}
|
||||
|
||||
if (moment.isMoment(range.from)) {
|
||||
var toMoment = dateMath.parse(range.to, true);
|
||||
return formatDate(range.from) + ' to ' + toMoment.fromNow();
|
||||
}
|
||||
|
||||
if (moment.isMoment(range.to)) {
|
||||
var from = dateMath.parse(range.from, false);
|
||||
return from.fromNow() + ' to ' + formatDate(range.to);
|
||||
}
|
||||
|
||||
if (range.to.toString() === 'now') {
|
||||
var res = describeTextRange(range.from);
|
||||
return res.display;
|
||||
}
|
||||
|
||||
return range.from.toString() + ' to ' + range.to.toString();
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@ import angular = require('angular');
|
||||
import _ = require('lodash');
|
||||
import moment = require('moment');
|
||||
import kbn = require('app/core/utils/kbn');
|
||||
import dateMath = require('app/core/utils/datemath');
|
||||
import rangeUtil = require('app/core/utils/rangeutil');
|
||||
|
||||
import * as dateMath from 'app/core/utils/datemath';
|
||||
import * as rangeUtil from 'app/core/utils/rangeutil';
|
||||
|
||||
declare var inputDate: any;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class PanelMeta {
|
||||
export default class PanelMeta {
|
||||
description: any;
|
||||
fullscreen: any;
|
||||
editIcon: any;
|
||||
@@ -46,4 +46,3 @@ class PanelMeta {
|
||||
}
|
||||
}
|
||||
|
||||
export = PanelMeta;
|
||||
+13
-322
@@ -3,8 +3,10 @@ System.config({
|
||||
defaultJSExtensions: true,
|
||||
transpiler: false,
|
||||
paths: {
|
||||
"github:*": "vendor/jspm/github/*",
|
||||
"npm:*": "vendor/jspm/npm/*",
|
||||
"github:*": "public/vendor/jspm/github/*",
|
||||
"npm:*": "public/vendor/jspm/npm/*",
|
||||
"angular": "vendor/jquery/dist/jquery.js",
|
||||
"jquery": "vendor/angular/angular.js",
|
||||
"bootstrap": "vendor/bootstrap/bootstrap.js",
|
||||
"angular-ui": "vendor/angular-ui/ui-bootstrap-tpls.js",
|
||||
"angular-strap": "vendor/angular-other/angular-strap.js",
|
||||
@@ -13,15 +15,15 @@ System.config({
|
||||
"spectrum": "vendor/spectrum.js",
|
||||
"filesaver": "vendor/filesaver.js",
|
||||
"bootstrap-tagsinput": "vendor/tagsinput/bootstrap-tagsinput.js",
|
||||
'jquery.flot': 'vendor/flot/jquery.flot',
|
||||
'jquery.flot.pie': 'vendor/flot/jquery.flot.pie',
|
||||
'jquery.flot.events': 'vendor/flot/jquery.flot.events',
|
||||
'jquery.flot.selection': 'vendor/flot/jquery.flot.selection',
|
||||
'jquery.flot.stack': 'vendor/flot/jquery.flot.stack',
|
||||
'jquery.flot.stackpercent':'vendor/flot/jquery.flot.stackpercent',
|
||||
'jquery.flot.time': 'vendor/flot/jquery.flot.time',
|
||||
'jquery.flot.crosshair': 'vendor/flot/jquery.flot.crosshair',
|
||||
'jquery.flot.fillbelow': 'vendor/flot/jquery.flot.fillbelow',
|
||||
"jquery.flot": "vendor/flot/jquery.flot",
|
||||
"jquery.flot.pie": "vendor/flot/jquery.flot.pie",
|
||||
"jquery.flot.events": "vendor/flot/jquery.flot.events",
|
||||
"jquery.flot.selection": "vendor/flot/jquery.flot.selection",
|
||||
"jquery.flot.stack": "vendor/flot/jquery.flot.stack",
|
||||
"jquery.flot.stackpercent": "vendor/flot/jquery.flot.stackpercent",
|
||||
"jquery.flot.time": "vendor/flot/jquery.flot.time",
|
||||
"jquery.flot.crosshair": "vendor/flot/jquery.flot.crosshair",
|
||||
"jquery.flot.fillbelow": "vendor/flot/jquery.flot.fillbelow"
|
||||
},
|
||||
|
||||
packages: {
|
||||
@@ -31,316 +33,5 @@ System.config({
|
||||
},
|
||||
|
||||
map: {
|
||||
"angular": "github:angular/bower-angular@1.4.5",
|
||||
"angular-route": "github:angular/bower-angular-route@1.4.5",
|
||||
"angular-sanitize": "github:angular/bower-angular-sanitize@1.4.5",
|
||||
"angular2/angular2": "npm:angular2@2.0.0-alpha.54/bundles/angular2.dev",
|
||||
"babel": "npm:babel-core@5.8.34",
|
||||
"babel-runtime": "npm:babel-runtime@5.8.34",
|
||||
"core-js": "npm:core-js@1.2.6",
|
||||
"es6-promise": "npm:es6-promise@3.0.2",
|
||||
"es6-shim": "npm:es6-shim@0.33.13",
|
||||
"jquery": "github:components/jquery@2.1.4",
|
||||
"lodash": "npm:lodash@3.10.1",
|
||||
"moment": "github:moment/moment@2.10.6",
|
||||
"github:angular/bower-angular-route@1.4.5": {
|
||||
"angular": "github:angular/bower-angular@1.4.5"
|
||||
},
|
||||
"github:angular/bower-angular-sanitize@1.4.5": {
|
||||
"angular": "github:angular/bower-angular@1.4.5"
|
||||
},
|
||||
"github:jspm/nodelibs-assert@0.1.0": {
|
||||
"assert": "npm:assert@1.3.0"
|
||||
},
|
||||
"github:jspm/nodelibs-buffer@0.1.0": {
|
||||
"buffer": "npm:buffer@3.5.5"
|
||||
},
|
||||
"github:jspm/nodelibs-constants@0.1.0": {
|
||||
"constants-browserify": "npm:constants-browserify@0.0.1"
|
||||
},
|
||||
"github:jspm/nodelibs-crypto@0.1.0": {
|
||||
"crypto-browserify": "npm:crypto-browserify@3.11.0"
|
||||
},
|
||||
"github:jspm/nodelibs-events@0.1.1": {
|
||||
"events": "npm:events@1.0.2"
|
||||
},
|
||||
"github:jspm/nodelibs-path@0.1.0": {
|
||||
"path-browserify": "npm:path-browserify@0.0.0"
|
||||
},
|
||||
"github:jspm/nodelibs-process@0.1.2": {
|
||||
"process": "npm:process@0.11.2"
|
||||
},
|
||||
"github:jspm/nodelibs-stream@0.1.0": {
|
||||
"stream-browserify": "npm:stream-browserify@1.0.0"
|
||||
},
|
||||
"github:jspm/nodelibs-string_decoder@0.1.0": {
|
||||
"string_decoder": "npm:string_decoder@0.10.31"
|
||||
},
|
||||
"github:jspm/nodelibs-util@0.1.0": {
|
||||
"util": "npm:util@0.10.3"
|
||||
},
|
||||
"github:jspm/nodelibs-vm@0.1.0": {
|
||||
"vm-browserify": "npm:vm-browserify@0.0.4"
|
||||
},
|
||||
"npm:angular2@2.0.0-alpha.54": {
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"es6-promise": "npm:es6-promise@3.0.2",
|
||||
"es6-shim": "npm:es6-shim@0.33.13",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2",
|
||||
"reflect-metadata": "npm:reflect-metadata@0.1.2",
|
||||
"rxjs": "npm:rxjs@5.0.0-beta.0",
|
||||
"zone.js": "npm:zone.js@0.5.10"
|
||||
},
|
||||
"npm:asn1.js@4.2.1": {
|
||||
"assert": "github:jspm/nodelibs-assert@0.1.0",
|
||||
"bn.js": "npm:bn.js@4.5.2",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"minimalistic-assert": "npm:minimalistic-assert@1.0.0",
|
||||
"vm": "github:jspm/nodelibs-vm@0.1.0"
|
||||
},
|
||||
"npm:assert@1.3.0": {
|
||||
"util": "npm:util@0.10.3"
|
||||
},
|
||||
"npm:babel-runtime@5.8.34": {
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:browserify-aes@1.0.5": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"buffer-xor": "npm:buffer-xor@1.0.3",
|
||||
"cipher-base": "npm:cipher-base@1.0.2",
|
||||
"create-hash": "npm:create-hash@1.1.2",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"evp_bytestokey": "npm:evp_bytestokey@1.0.0",
|
||||
"fs": "github:jspm/nodelibs-fs@0.1.2",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:browserify-cipher@1.0.0": {
|
||||
"browserify-aes": "npm:browserify-aes@1.0.5",
|
||||
"browserify-des": "npm:browserify-des@1.0.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"evp_bytestokey": "npm:evp_bytestokey@1.0.0"
|
||||
},
|
||||
"npm:browserify-des@1.0.0": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"cipher-base": "npm:cipher-base@1.0.2",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"des.js": "npm:des.js@1.0.0",
|
||||
"inherits": "npm:inherits@2.0.1"
|
||||
},
|
||||
"npm:browserify-rsa@4.0.0": {
|
||||
"bn.js": "npm:bn.js@4.5.2",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"constants": "github:jspm/nodelibs-constants@0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"randombytes": "npm:randombytes@2.0.1"
|
||||
},
|
||||
"npm:browserify-sign@4.0.0": {
|
||||
"bn.js": "npm:bn.js@4.5.2",
|
||||
"browserify-rsa": "npm:browserify-rsa@4.0.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"create-hash": "npm:create-hash@1.1.2",
|
||||
"create-hmac": "npm:create-hmac@1.1.4",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"elliptic": "npm:elliptic@6.0.2",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"parse-asn1": "npm:parse-asn1@5.0.0",
|
||||
"stream": "github:jspm/nodelibs-stream@0.1.0"
|
||||
},
|
||||
"npm:buffer-xor@1.0.3": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:buffer@3.5.5": {
|
||||
"base64-js": "npm:base64-js@0.0.8",
|
||||
"child_process": "github:jspm/nodelibs-child_process@0.1.0",
|
||||
"fs": "github:jspm/nodelibs-fs@0.1.2",
|
||||
"ieee754": "npm:ieee754@1.1.6",
|
||||
"isarray": "npm:isarray@1.0.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:cipher-base@1.0.2": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"stream": "github:jspm/nodelibs-stream@0.1.0",
|
||||
"string_decoder": "github:jspm/nodelibs-string_decoder@0.1.0"
|
||||
},
|
||||
"npm:constants-browserify@0.0.1": {
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:core-js@1.2.6": {
|
||||
"fs": "github:jspm/nodelibs-fs@0.1.2",
|
||||
"path": "github:jspm/nodelibs-path@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:core-util-is@1.0.2": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0"
|
||||
},
|
||||
"npm:create-ecdh@4.0.0": {
|
||||
"bn.js": "npm:bn.js@4.5.2",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"elliptic": "npm:elliptic@6.0.2"
|
||||
},
|
||||
"npm:create-hash@1.1.2": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"cipher-base": "npm:cipher-base@1.0.2",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"fs": "github:jspm/nodelibs-fs@0.1.2",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"ripemd160": "npm:ripemd160@1.0.1",
|
||||
"sha.js": "npm:sha.js@2.4.4"
|
||||
},
|
||||
"npm:create-hmac@1.1.4": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"create-hash": "npm:create-hash@1.1.2",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"stream": "github:jspm/nodelibs-stream@0.1.0"
|
||||
},
|
||||
"npm:crypto-browserify@3.11.0": {
|
||||
"browserify-cipher": "npm:browserify-cipher@1.0.0",
|
||||
"browserify-sign": "npm:browserify-sign@4.0.0",
|
||||
"create-ecdh": "npm:create-ecdh@4.0.0",
|
||||
"create-hash": "npm:create-hash@1.1.2",
|
||||
"create-hmac": "npm:create-hmac@1.1.4",
|
||||
"diffie-hellman": "npm:diffie-hellman@5.0.0",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"pbkdf2": "npm:pbkdf2@3.0.4",
|
||||
"public-encrypt": "npm:public-encrypt@4.0.0",
|
||||
"randombytes": "npm:randombytes@2.0.1"
|
||||
},
|
||||
"npm:des.js@1.0.0": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"minimalistic-assert": "npm:minimalistic-assert@1.0.0"
|
||||
},
|
||||
"npm:diffie-hellman@5.0.0": {
|
||||
"bn.js": "npm:bn.js@4.5.2",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"miller-rabin": "npm:miller-rabin@4.0.0",
|
||||
"randombytes": "npm:randombytes@2.0.1",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:elliptic@6.0.2": {
|
||||
"bn.js": "npm:bn.js@4.5.2",
|
||||
"brorand": "npm:brorand@1.0.5",
|
||||
"hash.js": "npm:hash.js@1.0.3",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:es6-promise@3.0.2": {
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:es6-shim@0.33.13": {
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:evp_bytestokey@1.0.0": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"create-hash": "npm:create-hash@1.1.2",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0"
|
||||
},
|
||||
"npm:hash.js@1.0.3": {
|
||||
"inherits": "npm:inherits@2.0.1"
|
||||
},
|
||||
"npm:inherits@2.0.1": {
|
||||
"util": "github:jspm/nodelibs-util@0.1.0"
|
||||
},
|
||||
"npm:lodash@3.10.1": {
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:miller-rabin@4.0.0": {
|
||||
"bn.js": "npm:bn.js@4.5.2",
|
||||
"brorand": "npm:brorand@1.0.5"
|
||||
},
|
||||
"npm:parse-asn1@5.0.0": {
|
||||
"asn1.js": "npm:asn1.js@4.2.1",
|
||||
"browserify-aes": "npm:browserify-aes@1.0.5",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"create-hash": "npm:create-hash@1.1.2",
|
||||
"evp_bytestokey": "npm:evp_bytestokey@1.0.0",
|
||||
"pbkdf2": "npm:pbkdf2@3.0.4",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:path-browserify@0.0.0": {
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:pbkdf2@3.0.4": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"child_process": "github:jspm/nodelibs-child_process@0.1.0",
|
||||
"create-hmac": "npm:create-hmac@1.1.4",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"path": "github:jspm/nodelibs-path@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:process@0.11.2": {
|
||||
"assert": "github:jspm/nodelibs-assert@0.1.0"
|
||||
},
|
||||
"npm:public-encrypt@4.0.0": {
|
||||
"bn.js": "npm:bn.js@4.5.2",
|
||||
"browserify-rsa": "npm:browserify-rsa@4.0.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"create-hash": "npm:create-hash@1.1.2",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"parse-asn1": "npm:parse-asn1@5.0.0",
|
||||
"randombytes": "npm:randombytes@2.0.1"
|
||||
},
|
||||
"npm:randombytes@2.0.1": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:readable-stream@1.1.13": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"core-util-is": "npm:core-util-is@1.0.2",
|
||||
"events": "github:jspm/nodelibs-events@0.1.1",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"isarray": "npm:isarray@0.0.1",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2",
|
||||
"stream-browserify": "npm:stream-browserify@1.0.0",
|
||||
"string_decoder": "npm:string_decoder@0.10.31"
|
||||
},
|
||||
"npm:reflect-metadata@0.1.2": {
|
||||
"assert": "github:jspm/nodelibs-assert@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:ripemd160@1.0.1": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:rxjs@5.0.0-beta.0": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:sha.js@2.4.4": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"fs": "github:jspm/nodelibs-fs@0.1.2",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:stream-browserify@1.0.0": {
|
||||
"events": "github:jspm/nodelibs-events@0.1.1",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"readable-stream": "npm:readable-stream@1.1.13"
|
||||
},
|
||||
"npm:string_decoder@0.10.31": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0"
|
||||
},
|
||||
"npm:util@0.10.3": {
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
},
|
||||
"npm:vm-browserify@0.0.4": {
|
||||
"indexof": "npm:indexof@0.0.1"
|
||||
},
|
||||
"npm:zone.js@0.5.10": {
|
||||
"es6-promise": "npm:es6-promise@3.0.2",
|
||||
"process": "github:jspm/nodelibs-process@0.1.2"
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1,9 +1,9 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import _ = require('lodash');
|
||||
import queryPart = require('./query_part');
|
||||
import queryPart from './query_part';
|
||||
|
||||
class InfluxQuery {
|
||||
export default class InfluxQuery {
|
||||
target: any;
|
||||
selectModels: any[];
|
||||
groupByParts: any;
|
||||
@@ -212,5 +212,3 @@ measurement = '"' + measurement+ '"';
|
||||
return query;
|
||||
}
|
||||
}
|
||||
|
||||
export = InfluxQuery;
|
||||
@@ -421,7 +421,7 @@ class QueryPart {
|
||||
}
|
||||
}
|
||||
|
||||
export = {
|
||||
export default {
|
||||
create: function(part): any {
|
||||
return new QueryPart(part);
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import angular = require('angular');
|
||||
import _ = require('lodash');
|
||||
import moment = require('moment');
|
||||
import PanelMeta = require('app/features/panel/panel_meta');
|
||||
import PanelMeta from 'app/features/panel/panel_meta';
|
||||
|
||||
import {transformDataToTable} from './transformers';
|
||||
|
||||
@@ -128,4 +128,3 @@ export class TablePanelCtrl {
|
||||
$scope.init();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
import {transformers} from './transformers';
|
||||
|
||||
export class TableModel {
|
||||
columns: any[];
|
||||
rows: any[];
|
||||
|
||||
constructor() {
|
||||
this.columns = [];
|
||||
this.rows = [];
|
||||
}
|
||||
|
||||
sort(options) {
|
||||
if (options.col === null || this.columns.length <= options.col) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.rows.sort(function(a, b) {
|
||||
a = a[options.col];
|
||||
b = b[options.col];
|
||||
if (a < b) {
|
||||
return -1;
|
||||
}
|
||||
if (a > b) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
this.columns[options.col].sort = true;
|
||||
|
||||
if (options.desc) {
|
||||
this.rows.reverse();
|
||||
this.columns[options.col].desc = true;
|
||||
}
|
||||
}
|
||||
|
||||
static transform(data, panel) {
|
||||
var model = new TableModel();
|
||||
|
||||
if (!data || data.length === 0) {
|
||||
return model;
|
||||
}
|
||||
|
||||
var transformer = transformers[panel.transform];
|
||||
if (!transformer) {
|
||||
throw {message: 'Transformer ' + panel.transformer + ' not found'};
|
||||
}
|
||||
|
||||
transformer.transform(data, panel, model);
|
||||
return model;
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
import moment = require('moment');
|
||||
import _ = require('lodash');
|
||||
import flatten = require('app/core/utils/flatten');
|
||||
import TimeSeries = require('app/core/time_series');
|
||||
import TableModel = require('app/core/table_model');
|
||||
import flatten from 'app/core/utils/flatten';
|
||||
import TimeSeries from 'app/core/time_series';
|
||||
import TableModel from 'app/core/table_model';
|
||||
|
||||
var transformers = {};
|
||||
|
||||
|
||||
-317
@@ -1,317 +0,0 @@
|
||||
{
|
||||
"npm:lodash@3.10.1": {
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0"
|
||||
},
|
||||
"github:components/jquery@2.1.4": {},
|
||||
"github:moment/moment@2.10.6": {},
|
||||
"npm:assert@1.3.0": {
|
||||
"util": "npm:util@0.10.3"
|
||||
},
|
||||
"npm:util@0.10.3": {
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0"
|
||||
},
|
||||
"npm:inherits@2.0.1": {
|
||||
"util": "github:jspm/nodelibs-util@^0.1.0"
|
||||
},
|
||||
"github:jspm/nodelibs-assert@0.1.0": {
|
||||
"assert": "npm:assert@^1.3.0"
|
||||
},
|
||||
"github:jspm/nodelibs-util@0.1.0": {
|
||||
"util": "npm:util@^0.10.3"
|
||||
},
|
||||
"npm:babel-runtime@5.8.34": {
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0"
|
||||
},
|
||||
"npm:babel-core@5.8.34": {},
|
||||
"npm:core-js@1.2.6": {
|
||||
"systemjs-json": "github:systemjs/plugin-json@^0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0",
|
||||
"fs": "github:jspm/nodelibs-fs@^0.1.0",
|
||||
"path": "github:jspm/nodelibs-path@^0.1.0"
|
||||
},
|
||||
"npm:path-browserify@0.0.0": {
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0"
|
||||
},
|
||||
"github:systemjs/plugin-json@0.1.0": {},
|
||||
"github:jspm/nodelibs-fs@0.1.2": {},
|
||||
"github:jspm/nodelibs-path@0.1.0": {
|
||||
"path-browserify": "npm:path-browserify@0.0.0"
|
||||
},
|
||||
"npm:es6-promise@3.0.2": {
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0"
|
||||
},
|
||||
"npm:reflect-metadata@0.1.2": {
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0",
|
||||
"assert": "github:jspm/nodelibs-assert@^0.1.0"
|
||||
},
|
||||
"npm:es6-shim@0.33.13": {
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0"
|
||||
},
|
||||
"npm:zone.js@0.5.10": {
|
||||
"es6-promise": "npm:es6-promise@^3.0.2",
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0"
|
||||
},
|
||||
"npm:rxjs@5.0.0-beta.0": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0"
|
||||
},
|
||||
"npm:angular2@2.0.0-alpha.54": {
|
||||
"es6-promise": "npm:es6-promise@^3.0.2",
|
||||
"es6-shim": "npm:es6-shim@^0.33.3",
|
||||
"reflect-metadata": "npm:reflect-metadata@0.1.2",
|
||||
"rxjs": "npm:rxjs@5.0.0-beta.0",
|
||||
"zone.js": "npm:zone.js@0.5.10",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0"
|
||||
},
|
||||
"npm:buffer@3.5.5": {
|
||||
"base64-js": "npm:base64-js@0.0.8",
|
||||
"ieee754": "npm:ieee754@^1.1.4",
|
||||
"isarray": "npm:isarray@^1.0.0",
|
||||
"fs": "github:jspm/nodelibs-fs@^0.1.0",
|
||||
"child_process": "github:jspm/nodelibs-child_process@^0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0"
|
||||
},
|
||||
"npm:ieee754@1.1.6": {},
|
||||
"npm:isarray@1.0.0": {},
|
||||
"npm:base64-js@0.0.8": {},
|
||||
"github:jspm/nodelibs-buffer@0.1.0": {
|
||||
"buffer": "npm:buffer@^3.0.1"
|
||||
},
|
||||
"github:jspm/nodelibs-child_process@0.1.0": {},
|
||||
"npm:crypto-browserify@3.11.0": {
|
||||
"browserify-cipher": "npm:browserify-cipher@^1.0.0",
|
||||
"browserify-sign": "npm:browserify-sign@^4.0.0",
|
||||
"create-ecdh": "npm:create-ecdh@^4.0.0",
|
||||
"create-hash": "npm:create-hash@^1.1.0",
|
||||
"create-hmac": "npm:create-hmac@^1.1.0",
|
||||
"diffie-hellman": "npm:diffie-hellman@^5.0.0",
|
||||
"inherits": "npm:inherits@^2.0.1",
|
||||
"pbkdf2": "npm:pbkdf2@^3.0.3",
|
||||
"public-encrypt": "npm:public-encrypt@^4.0.0",
|
||||
"randombytes": "npm:randombytes@^2.0.0"
|
||||
},
|
||||
"npm:browserify-cipher@1.0.0": {
|
||||
"browserify-aes": "npm:browserify-aes@^1.0.4",
|
||||
"browserify-des": "npm:browserify-des@^1.0.0",
|
||||
"evp_bytestokey": "npm:evp_bytestokey@^1.0.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0"
|
||||
},
|
||||
"npm:create-ecdh@4.0.0": {
|
||||
"bn.js": "npm:bn.js@^4.1.0",
|
||||
"elliptic": "npm:elliptic@^6.0.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0"
|
||||
},
|
||||
"npm:create-hmac@1.1.4": {
|
||||
"create-hash": "npm:create-hash@^1.1.0",
|
||||
"inherits": "npm:inherits@^2.0.1",
|
||||
"stream": "github:jspm/nodelibs-stream@^0.1.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0"
|
||||
},
|
||||
"npm:create-hash@1.1.2": {
|
||||
"cipher-base": "npm:cipher-base@^1.0.1",
|
||||
"inherits": "npm:inherits@^2.0.1",
|
||||
"ripemd160": "npm:ripemd160@^1.0.0",
|
||||
"sha.js": "npm:sha.js@^2.3.6",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"fs": "github:jspm/nodelibs-fs@^0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0"
|
||||
},
|
||||
"npm:pbkdf2@3.0.4": {
|
||||
"create-hmac": "npm:create-hmac@^1.1.2",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0",
|
||||
"child_process": "github:jspm/nodelibs-child_process@^0.1.0",
|
||||
"path": "github:jspm/nodelibs-path@^0.1.0",
|
||||
"systemjs-json": "github:systemjs/plugin-json@^0.1.0"
|
||||
},
|
||||
"npm:diffie-hellman@5.0.0": {
|
||||
"bn.js": "npm:bn.js@^4.1.0",
|
||||
"miller-rabin": "npm:miller-rabin@^4.0.0",
|
||||
"randombytes": "npm:randombytes@^2.0.0",
|
||||
"systemjs-json": "github:systemjs/plugin-json@^0.1.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0"
|
||||
},
|
||||
"npm:browserify-aes@1.0.5": {
|
||||
"buffer-xor": "npm:buffer-xor@^1.0.2",
|
||||
"cipher-base": "npm:cipher-base@^1.0.0",
|
||||
"create-hash": "npm:create-hash@^1.1.0",
|
||||
"evp_bytestokey": "npm:evp_bytestokey@^1.0.0",
|
||||
"inherits": "npm:inherits@^2.0.1",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0",
|
||||
"systemjs-json": "github:systemjs/plugin-json@^0.1.0",
|
||||
"fs": "github:jspm/nodelibs-fs@^0.1.0"
|
||||
},
|
||||
"github:jspm/nodelibs-crypto@0.1.0": {
|
||||
"crypto-browserify": "npm:crypto-browserify@^3.7.2"
|
||||
},
|
||||
"npm:cipher-base@1.0.2": {
|
||||
"inherits": "npm:inherits@^2.0.1",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"stream": "github:jspm/nodelibs-stream@^0.1.0",
|
||||
"string_decoder": "github:jspm/nodelibs-string_decoder@^0.1.0"
|
||||
},
|
||||
"npm:ripemd160@1.0.1": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0"
|
||||
},
|
||||
"npm:browserify-sign@4.0.0": {
|
||||
"bn.js": "npm:bn.js@^4.1.1",
|
||||
"browserify-rsa": "npm:browserify-rsa@^4.0.0",
|
||||
"create-hash": "npm:create-hash@^1.1.0",
|
||||
"create-hmac": "npm:create-hmac@^1.1.2",
|
||||
"elliptic": "npm:elliptic@^6.0.0",
|
||||
"inherits": "npm:inherits@^2.0.1",
|
||||
"parse-asn1": "npm:parse-asn1@^5.0.0",
|
||||
"stream": "github:jspm/nodelibs-stream@^0.1.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0"
|
||||
},
|
||||
"npm:browserify-des@1.0.0": {
|
||||
"cipher-base": "npm:cipher-base@^1.0.1",
|
||||
"des.js": "npm:des.js@^1.0.0",
|
||||
"inherits": "npm:inherits@^2.0.1",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0"
|
||||
},
|
||||
"npm:public-encrypt@4.0.0": {
|
||||
"bn.js": "npm:bn.js@^4.1.0",
|
||||
"browserify-rsa": "npm:browserify-rsa@^4.0.0",
|
||||
"create-hash": "npm:create-hash@^1.1.0",
|
||||
"parse-asn1": "npm:parse-asn1@^5.0.0",
|
||||
"randombytes": "npm:randombytes@^2.0.1",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0"
|
||||
},
|
||||
"npm:bn.js@4.5.2": {},
|
||||
"npm:buffer-xor@1.0.3": {
|
||||
"systemjs-json": "github:systemjs/plugin-json@^0.1.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0"
|
||||
},
|
||||
"npm:browserify-rsa@4.0.0": {
|
||||
"bn.js": "npm:bn.js@^4.1.0",
|
||||
"randombytes": "npm:randombytes@^2.0.1",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0",
|
||||
"constants": "github:jspm/nodelibs-constants@^0.1.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0"
|
||||
},
|
||||
"npm:miller-rabin@4.0.0": {
|
||||
"bn.js": "npm:bn.js@^4.0.0",
|
||||
"brorand": "npm:brorand@^1.0.1"
|
||||
},
|
||||
"npm:des.js@1.0.0": {
|
||||
"inherits": "npm:inherits@^2.0.1",
|
||||
"minimalistic-assert": "npm:minimalistic-assert@^1.0.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0"
|
||||
},
|
||||
"npm:parse-asn1@5.0.0": {
|
||||
"asn1.js": "npm:asn1.js@^4.0.0",
|
||||
"browserify-aes": "npm:browserify-aes@^1.0.0",
|
||||
"create-hash": "npm:create-hash@^1.1.0",
|
||||
"evp_bytestokey": "npm:evp_bytestokey@^1.0.0",
|
||||
"pbkdf2": "npm:pbkdf2@^3.0.3",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"systemjs-json": "github:systemjs/plugin-json@^0.1.0"
|
||||
},
|
||||
"npm:brorand@1.0.5": {},
|
||||
"npm:randombytes@2.0.1": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0"
|
||||
},
|
||||
"npm:minimalistic-assert@1.0.0": {},
|
||||
"npm:asn1.js@4.2.1": {
|
||||
"bn.js": "npm:bn.js@^4.0.0",
|
||||
"inherits": "npm:inherits@^2.0.1",
|
||||
"minimalistic-assert": "npm:minimalistic-assert@^1.0.0",
|
||||
"vm": "github:jspm/nodelibs-vm@^0.1.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"assert": "github:jspm/nodelibs-assert@^0.1.0"
|
||||
},
|
||||
"npm:evp_bytestokey@1.0.0": {
|
||||
"create-hash": "npm:create-hash@^1.1.1",
|
||||
"crypto": "github:jspm/nodelibs-crypto@^0.1.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0"
|
||||
},
|
||||
"npm:sha.js@2.4.4": {
|
||||
"inherits": "npm:inherits@^2.0.1",
|
||||
"fs": "github:jspm/nodelibs-fs@^0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0"
|
||||
},
|
||||
"npm:elliptic@6.0.2": {
|
||||
"bn.js": "npm:bn.js@^4.0.0",
|
||||
"brorand": "npm:brorand@^1.0.1",
|
||||
"hash.js": "npm:hash.js@^1.0.0",
|
||||
"inherits": "npm:inherits@^2.0.1",
|
||||
"systemjs-json": "github:systemjs/plugin-json@^0.1.0"
|
||||
},
|
||||
"npm:hash.js@1.0.3": {
|
||||
"inherits": "npm:inherits@^2.0.1"
|
||||
},
|
||||
"npm:stream-browserify@1.0.0": {
|
||||
"inherits": "npm:inherits@~2.0.1",
|
||||
"readable-stream": "npm:readable-stream@^1.0.27-1",
|
||||
"events": "github:jspm/nodelibs-events@^0.1.1"
|
||||
},
|
||||
"npm:string_decoder@0.10.31": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0"
|
||||
},
|
||||
"npm:isarray@0.0.1": {},
|
||||
"npm:readable-stream@1.1.13": {
|
||||
"core-util-is": "npm:core-util-is@~1.0.0",
|
||||
"inherits": "npm:inherits@~2.0.1",
|
||||
"isarray": "npm:isarray@0.0.1",
|
||||
"string_decoder": "npm:string_decoder@~0.10.0",
|
||||
"stream-browserify": "npm:stream-browserify@^1.0.0",
|
||||
"process": "github:jspm/nodelibs-process@^0.1.0",
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0",
|
||||
"events": "github:jspm/nodelibs-events@^0.1.1"
|
||||
},
|
||||
"npm:core-util-is@1.0.2": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@^0.1.0"
|
||||
},
|
||||
"npm:constants-browserify@0.0.1": {
|
||||
"systemjs-json": "github:systemjs/plugin-json@^0.1.0"
|
||||
},
|
||||
"github:jspm/nodelibs-stream@0.1.0": {
|
||||
"stream-browserify": "npm:stream-browserify@^1.0.0"
|
||||
},
|
||||
"npm:vm-browserify@0.0.4": {
|
||||
"indexof": "npm:indexof@0.0.1"
|
||||
},
|
||||
"github:jspm/nodelibs-string_decoder@0.1.0": {
|
||||
"string_decoder": "npm:string_decoder@^0.10.31"
|
||||
},
|
||||
"npm:indexof@0.0.1": {},
|
||||
"github:jspm/nodelibs-constants@0.1.0": {
|
||||
"constants-browserify": "npm:constants-browserify@0.0.1"
|
||||
},
|
||||
"github:jspm/nodelibs-vm@0.1.0": {
|
||||
"vm-browserify": "npm:vm-browserify@0.0.4"
|
||||
},
|
||||
"npm:events@1.0.2": {},
|
||||
"github:jspm/nodelibs-events@0.1.1": {
|
||||
"events": "npm:events@1.0.2"
|
||||
},
|
||||
"github:angular/bower-angular-route@1.4.5": {
|
||||
"angular": "jspm:angular@^1.3.0"
|
||||
},
|
||||
"github:angular/bower-angular-sanitize@1.4.5": {
|
||||
"angular": "jspm:angular@^1.3.0"
|
||||
},
|
||||
"github:angular/bower-angular@1.4.5": {},
|
||||
"github:jspm/nodelibs-process@0.1.2": {
|
||||
"process": "npm:process@^0.11.0"
|
||||
},
|
||||
"npm:process@0.11.2": {
|
||||
"assert": "github:jspm/nodelibs-assert@^0.1.0"
|
||||
}
|
||||
}
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
0.19.7
|
||||
File diff suppressed because it is too large.
Load diff
+36742
File diff suppressed because it is too large.
Load diff
+36741
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,18 @@
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Rx"),require("rxjs/observable/fromPromise"),require("rxjs/operator/toPromise")):"function"==typeof define&&define.amd?define(["Rx","rxjs/observable/fromPromise","rxjs/operator/toPromise"],t):"object"==typeof exports?exports.ng=t(require("Rx"),require("rxjs/observable/fromPromise"),require("rxjs/operator/toPromise")):e.ng=t(e.Rx,e.Rx.Observable,e.Rx.Observable.prototype)}(this,function(e,t,n){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){t.core=n(2),t.common=n(104),t.compiler=n(147),t.platform={browser:n(179),common_dom:n(203)},t.http=n(209),t.router=n(224),t.router_link_dsl=n(248),t.instrumentation=n(250),t.upgrade=n(251)},function(e,t,n){function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}r(n(3)),r(n(57)),r(n(58)),r(n(6)),r(n(59));var i=n(5);t.enableProdMode=i.enableProdMode;var o=n(65);t.platform=o.platform,t.createNgZone=o.createNgZone,t.PlatformRef=o.PlatformRef,t.ApplicationRef=o.ApplicationRef;var s=n(67);t.APP_ID=s.APP_ID,t.APP_COMPONENT=s.APP_COMPONENT,t.APP_INITIALIZER=s.APP_INITIALIZER,t.PACKAGE_ROOT_URL=s.PACKAGE_ROOT_URL,t.PLATFORM_INITIALIZER=s.PLATFORM_INITIALIZER,r(n(98)),r(n(99)),r(n(100));var a=n(101);t.DebugElement=a.DebugElement,t.Scope=a.Scope,t.inspectElement=a.inspectElement,t.asNativeElements=a.asNativeElements,r(n(68)),r(n(24)),r(n(95)),r(n(102)),r(n(103)),r(n(16))},function(e,t,n){var r=n(4);t.QueryMetadata=r.QueryMetadata,t.ContentChildrenMetadata=r.ContentChildrenMetadata,t.ContentChildMetadata=r.ContentChildMetadata,t.ViewChildrenMetadata=r.ViewChildrenMetadata,t.ViewQueryMetadata=r.ViewQueryMetadata,t.ViewChildMetadata=r.ViewChildMetadata,t.AttributeMetadata=r.AttributeMetadata;var i=n(23);t.ComponentMetadata=i.ComponentMetadata,t.DirectiveMetadata=i.DirectiveMetadata,t.PipeMetadata=i.PipeMetadata,t.InputMetadata=i.InputMetadata,t.OutputMetadata=i.OutputMetadata,t.HostBindingMetadata=i.HostBindingMetadata,t.HostListenerMetadata=i.HostListenerMetadata;var o=n(56);t.ViewMetadata=o.ViewMetadata,t.ViewEncapsulation=o.ViewEncapsulation;var s=n(4),a=n(23),c=n(56),u=n(9);t.Component=u.makeDecorator(a.ComponentMetadata,function(e){return e.View=t.View}),t.Directive=u.makeDecorator(a.DirectiveMetadata),t.View=u.makeDecorator(c.ViewMetadata,function(e){return e.View=t.View}),t.Attribute=u.makeParamDecorator(s.AttributeMetadata),t.Query=u.makeParamDecorator(s.QueryMetadata),t.ContentChildren=u.makePropDecorator(s.ContentChildrenMetadata),t.ContentChild=u.makePropDecorator(s.ContentChildMetadata),t.ViewChildren=u.makePropDecorator(s.ViewChildrenMetadata),t.ViewChild=u.makePropDecorator(s.ViewChildMetadata),t.ViewQuery=u.makeParamDecorator(s.ViewQueryMetadata),t.Pipe=u.makeDecorator(a.PipeMetadata),t.Input=u.makePropDecorator(a.InputMetadata),t.Output=u.makePropDecorator(a.OutputMetadata),t.HostBinding=u.makePropDecorator(a.HostBindingMetadata),t.HostListener=u.makePropDecorator(a.HostListenerMetadata)},function(e,t,n){var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=n(5),a=n(6),c=n(7),u=function(e){function t(t){e.call(this),this.attributeName=t}return r(t,e),Object.defineProperty(t.prototype,"token",{get:function(){return this},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"@Attribute("+s.stringify(this.attributeName)+")"},t=i([s.CONST(),o("design:paramtypes",[String])],t)}(c.DependencyMetadata);t.AttributeMetadata=u;var p=function(e){function t(t,n){var r=void 0===n?{}:n,i=r.descendants,o=void 0===i?!1:i,s=r.first,a=void 0===s?!1:s;e.call(this),this._selector=t,this.descendants=o,this.first=a}return r(t,e),Object.defineProperty(t.prototype,"isViewQuery",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selector",{get:function(){return a.resolveForwardRef(this._selector)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVarBindingQuery",{get:function(){return s.isString(this.selector)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"varBindings",{get:function(){return this.selector.split(",")},enumerable:!0,configurable:!0}),t.prototype.toString=function(){returLine truncated
|
||||
var t={};return e.forEach(function(e,n){return t[n]=e}),t},e.createFromPairs=function(e){return s(e)},e.clearValues=function(e){c(e)},e.iterable=function(e){return e},e.keys=function(e){return u(e,!1)},e.values=function(e){return u(e,!0)},e}();t.MapWrapper=p;var l=function(){function e(){}return e.create=function(){return{}},e.contains=function(e,t){return e.hasOwnProperty(t)},e.get=function(e,t){return e.hasOwnProperty(t)?e[t]:void 0},e.set=function(e,t,n){e[t]=n},e.keys=function(e){return Object.keys(e)},e.isEmpty=function(e){for(var t in e)return!1;return!0},e["delete"]=function(e,t){delete e[t]},e.forEach=function(e,t){for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)},e.merge=function(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n},e.equals=function(e,t){var n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(var i,o=0;o<n.length;o++)if(i=n[o],e[i]!==t[i])return!1;return!0},e}();t.StringMapWrapper=l;var h=function(){function e(){}return e.createFixedSize=function(e){return new Array(e)},e.createGrowableSize=function(e){return new Array(e)},e.clone=function(e){return e.slice(0)},e.forEachWithIndex=function(e,t){for(var n=0;n<e.length;n++)t(e[n],n)},e.first=function(e){return e?e[0]:null},e.last=function(e){return e&&0!=e.length?e[e.length-1]:null},e.indexOf=function(e,t,n){return void 0===n&&(n=0),e.indexOf(t,n)},e.contains=function(e,t){return-1!==e.indexOf(t)},e.reversed=function(t){var n=e.clone(t);return n.reverse()},e.concat=function(e,t){return e.concat(t)},e.insert=function(e,t,n){e.splice(t,0,n)},e.removeAt=function(e,t){var n=e[t];return e.splice(t,1),n},e.removeAll=function(e,t){for(var n=0;n<t.length;++n){var r=e.indexOf(t[n]);e.splice(r,1)}},e.remove=function(e,t){var n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1},e.clear=function(e){e.length=0},e.isEmpty=function(e){return 0==e.length},e.fill=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=null),e.fill(t,n,null===r?e.length:r)},e.equals=function(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0},e.slice=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=null),e.slice(t,null===n?void 0:n)},e.splice=function(e,t,n){return e.splice(t,n)},e.sort=function(e,t){o.isPresent(t)?e.sort(t):e.sort()},e.toString=function(e){return e.toString()},e.toJSON=function(e){return JSON.stringify(e)},e.maximum=function(e,t){if(0==e.length)return null;for(var n=null,r=-(1/0),i=0;i<e.length;i++){var s=e[i];if(!o.isBlank(s)){var a=t(s);a>r&&(n=s,r=a)}}return n},e}();t.ListWrapper=h,t.isListLikeIterable=r,t.iterateListLike=i;var f=function(){var e=new t.Set([1,2,3]);return 3===e.size?function(e){return new t.Set(e)}:function(e){var n=new t.Set(e);if(n.size!==e.length)for(var r=0;r<e.length;r++)n.add(e[r]);return n}}(),d=function(){function e(){}return e.createFromList=function(e){return f(e)},e.has=function(e,t){return e.has(t)},e["delete"]=function(e,t){e["delete"](t)},e}();t.SetWrapper=d},function(e,t,n){function r(e){return new x(e)}function i(e,t){var n=t.useClass,r=t.useValue,i=t.useExisting,o=t.useFactory,s=t.deps,a=t.multi;return new D(e,{useClass:n,useValue:r,useExisting:i,useFactory:o,deps:s,multi:a})}function o(e){var t,n;if(g.isPresent(e.useClass)){var r=E.resolveForwardRef(e.useClass);t=C.reflector.factory(r),n=h(r)}else g.isPresent(e.useExisting)?(t=function(e){return e},n=[O.fromKey(P.Key.get(e.useExisting))]):g.isPresent(e.useFactory)?(t=e.useFactory,n=l(e.useFactory,e.dependencies)):(t=function(){return e.useValue},n=S);return new I(t,n)}function s(e){return new A(P.Key.get(e.token),[o(e)],!1)}function a(e){var t=c(u(e,new Map));return t.map(function(e){if(e instanceof N)return new A(e.key,[e.resolvedFactory],!1);var t=e;return new A(t[0].key,t.map(function(e){return e.resolvedFactory}),!0)})}function c(e){return b.MapWrapper.values(e)}function u(e,t){return e.forEach(function(e){if(e instanceof g.Type)p(i(e,{useClass:e}),t);else if(e instanceof D)p(e,t);else{if(!(e instanceof Array))throw e instanceof x?new R.InvalidProviderError(e.token):new R.InvalidProviderError(e);u(e,t)}}),t}function p(e,t){var n=P.Key.get(e.token),r=o(e),i=new N(n,r);if(e.multi){var s=t.get(n.id);if(s instanceof Array)s.push(i);else{if(!g.isBlank(s))throw new R.MixingMultiProvidersWithRegularProvidersError(s,e);t.set(n.id,[i])}}else{var s=t.get(n.id);if(s instanceof Array)throw new R.MixingMultiProvidersWithRegularProvidersError(s,e);t.set(n.id,i)}}function l(e,t){if(g.isBlank(t))return h(e);var n=t.map(function(e){return[e]});return t.map(function(t){return f(e,t,n)})}function h(e){var t=C.reflector.parameters(e);if(g.isBlank(t))return[];if(t.some(g.isBlank))throw new R.NoAnnotationError(e,t);return t.map(function(n){return f(e,n,t)})}function f(e,t,n){var r=[],i=null,o=!1;if(!g.isArray(t))return t instanceof w.InjectMetadata?d(t.token,o,null,null,r):d(t,o,null,null,r);for(var s=null,a=null,c=0;c<t.length;++c){var u=t[c];u instanceof gLine truncated
|
||||
return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},o=n(5),s=n(14),a=n(12),c=n(5),u=function(){function e(){}return e.prototype.supports=function(e){return a.isListLikeIterable(e)},e.prototype.create=function(e){return new p},e=r([o.CONST(),i("design:paramtypes",[])],e)}();t.DefaultIterableDifferFactory=u;var p=function(){function e(){this._collection=null,this._length=null,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(e.prototype,"collection",{get:function(){return this._collection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),e.prototype.forEachItem=function(e){var t;for(t=this._itHead;null!==t;t=t._next)e(t)},e.prototype.forEachPreviousItem=function(e){var t;for(t=this._previousItHead;null!==t;t=t._nextPrevious)e(t)},e.prototype.forEachAddedItem=function(e){var t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)},e.prototype.forEachMovedItem=function(e){var t;for(t=this._movesHead;null!==t;t=t._nextMoved)e(t)},e.prototype.forEachRemovedItem=function(e){var t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)},e.prototype.diff=function(e){if(c.isBlank(e)&&(e=[]),!a.isListLikeIterable(e))throw new s.BaseException("Error trying to diff '"+e+"'");return this.check(e)?this:null},e.prototype.onDestroy=function(){},e.prototype.check=function(e){var t=this;this._reset();var n,r,i=this._itHead,o=!1;if(c.isArray(e)){var s=e;for(this._length=e.length,n=0;n<this._length;n++)r=s[n],null!==i&&c.looseIdentical(i.item,r)?o&&(i=this._verifyReinsertion(i,r,n)):(i=this._mismatch(i,r,n),o=!0),i=i._next}else n=0,a.iterateListLike(e,function(e){null!==i&&c.looseIdentical(i.item,e)?o&&(i=t._verifyReinsertion(i,e,n)):(i=t._mismatch(i,e,n),o=!0),i=i._next,n++}),this._length=n;return this._truncate(i),this._collection=e,this.isDirty},Object.defineProperty(e.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead},enumerable:!0,configurable:!0}),e.prototype._reset=function(){if(this.isDirty){var e,t;for(e=this._previousItHead=this._itHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;null!==e;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;null!==e;e=t)e.previousIndex=e.currentIndex,t=e._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null}},e.prototype._mismatch=function(e,t,n){var r;return null===e?r=this._itTail:(r=e._prev,this._remove(e)),e=null===this._linkedRecords?null:this._linkedRecords.get(t,n),null!==e?this._moveAfter(e,r,n):(e=null===this._unlinkedRecords?null:this._unlinkedRecords.get(t),null!==e?this._reinsertAfter(e,r,n):e=this._addAfter(new l(t),r,n)),e},e.prototype._verifyReinsertion=function(e,t,n){var r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(t);return null!==r?e=this._reinsertAfter(r,e._prev,n):e.currentIndex!=n&&(e.currentIndex=n,this._addToMoves(e,n)),e},e.prototype._truncate=function(e){for(;null!==e;){var t=e._next;this._addToRemovals(this._unlink(e)),e=t}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null)},e.prototype._reinsertAfter=function(e,t,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(e);var r=e._prevRemoved,i=e._nextRemoved;return null===r?this._removalsHead=i:r._nextRemoved=i,null===i?this._removalsTail=r:i._prevRemoved=r,this._insertAfter(e,t,n),this._addToMoves(e,n),e},e.prototype._moveAfter=function(e,t,n){return this._unlink(e),this._insertAfter(e,t,n),this._addToMoves(e,n),e},e.prototype._addAfter=function(e,t,n){return this._insertAfter(e,t,n),null===this._additionsTail?this._additionsTail=this._additionsHead=e:this._additionsTail=this._additionsTail._nextAdded=e,e},e.prototype._insertAfter=function(e,t,n){var r=null===t?this._itHead:t._next;return e._next=r,e._prev=t,null===r?this._itTail=e:r._prev=e,null===t?this._itHead=e:t._next=e,null===this._linkedRecords&&(this._linkedRecords=new f),this._linkedRecords.put(e),e.currentIndex=n,e},e.prototype._remove=function(e){return this._addToRemovals(this._unlink(e))},e.prototype._unlink=function(e){null!==this._linkedRecords&&this._linkedRecords.remove(e);var t=e._prev,n=e._next;return null===t?this._itHead=n:t._next=n,null===n?this._itTail=t:n._prev=t,e},e.prototype._addToMoves=function(e,t){return e.previousIndex==Line truncated
|
||||
return new m(e,t,r,this._reflector,!1).parseChain()},e.prototype._parseQuote=function(e,t){if(a.isBlank(e))return null;var n=e.indexOf(":");if(-1==n)return null;var r=e.substring(0,n).trim();if(!p.isIdentifier(r))return null;var i=e.substring(n+1);return new h.Quote(r,i,t)},e.prototype.parseTemplateBindings=function(e,t){var n=this._lexer.tokenize(e);return new m(e,t,n,this._reflector,!1).parseTemplateBindings()},e.prototype.parseInterpolation=function(e,t){var n=a.StringWrapper.split(e,d);if(n.length<=1)return null;for(var r=[],i=[],o=0;o<n.length;o++){var s=n[o];if(o%2===0)r.push(s);else{if(!(s.trim().length>0))throw new y("Blank expressions are not allowed in interpolated strings",e,"at column "+this._findInterpolationErrorColumn(n,o)+" in",t);var c=this._lexer.tokenize(s),u=new m(e,t,c,this._reflector,!1).parseChain();i.push(u)}}return new h.ASTWithSource(new h.Interpolation(r,i),e,t)},e.prototype.wrapLiteralPrimitive=function(e,t){return new h.ASTWithSource(new h.LiteralPrimitive(e),e,t)},e.prototype._checkNoInterpolation=function(e,t){var n=a.StringWrapper.split(e,d);if(n.length>1)throw new y("Got interpolation ({{}}) where expression was expected",e,"at column "+this._findInterpolationErrorColumn(n,1)+" in",t)},e.prototype._findInterpolationErrorColumn=function(e,t){for(var n="",r=0;t>r;r++)n+=r%2===0?e[r]:"{{"+e[r]+"}}";return n.length},e=i([s.Injectable(),o("design:paramtypes",[p.Lexer,l.Reflector])],e)}();t.Parser=v;var m=function(){function e(e,t,n,r,i){this.input=e,this.location=t,this.tokens=n,this.reflector=r,this.parseAction=i,this.index=0}return e.prototype.peek=function(e){var t=this.index+e;return t<this.tokens.length?this.tokens[t]:p.EOF},Object.defineProperty(e.prototype,"next",{get:function(){return this.peek(0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputIndex",{get:function(){return this.index<this.tokens.length?this.next.index:this.input.length},enumerable:!0,configurable:!0}),e.prototype.advance=function(){this.index++},e.prototype.optionalCharacter=function(e){return this.next.isCharacter(e)?(this.advance(),!0):!1},e.prototype.optionalKeywordVar=function(){return this.peekKeywordVar()?(this.advance(),!0):!1},e.prototype.peekKeywordVar=function(){return this.next.isKeywordVar()||this.next.isOperator("#")},e.prototype.expectCharacter=function(e){this.optionalCharacter(e)||this.error("Missing expected "+a.StringWrapper.fromCharCode(e))},e.prototype.optionalOperator=function(e){return this.next.isOperator(e)?(this.advance(),!0):!1},e.prototype.expectOperator=function(e){this.optionalOperator(e)||this.error("Missing expected operator "+e)},e.prototype.expectIdentifierOrKeyword=function(){var e=this.next;return e.isIdentifier()||e.isKeyword()||this.error("Unexpected token "+e+", expected identifier or keyword"),this.advance(),e.toString()},e.prototype.expectIdentifierOrKeywordOrString=function(){var e=this.next;return e.isIdentifier()||e.isKeyword()||e.isString()||this.error("Unexpected token "+e+", expected identifier, keyword, or string"),this.advance(),e.toString()},e.prototype.parseChain=function(){for(var e=[];this.index<this.tokens.length;){var t=this.parsePipe();if(e.push(t),this.optionalCharacter(p.$SEMICOLON))for(this.parseAction||this.error("Binding expression cannot contain chained expression");this.optionalCharacter(p.$SEMICOLON););else this.index<this.tokens.length&&this.error("Unexpected token '"+this.next+"'")}return 0==e.length?new h.EmptyExpr:1==e.length?e[0]:new h.Chain(e)},e.prototype.parsePipe=function(){var e=this.parseExpression();if(this.optionalOperator("|")){this.parseAction&&this.error("Cannot have a pipe in an action expression");do{for(var t=this.expectIdentifierOrKeyword(),n=[];this.optionalCharacter(p.$COLON);)n.push(this.parseExpression());e=new h.BindingPipe(e,t,n)}while(this.optionalOperator("|"))}return e},e.prototype.parseExpression=function(){return this.parseConditional()},e.prototype.parseConditional=function(){var e=this.inputIndex,t=this.parseLogicalOr();if(this.optionalOperator("?")){var n=this.parsePipe();if(!this.optionalCharacter(p.$COLON)){var r=this.inputIndex,i=this.input.substring(e,r);this.error("Conditional expression "+i+" requires all 3 expressions")}var o=this.parsePipe();return new h.Conditional(t,n,o)}return t},e.prototype.parseLogicalOr=function(){for(var e=this.parseLogicalAnd();this.optionalOperator("||");)e=new h.Binary("||",e,this.parseLogicalAnd());return e},e.prototype.parseLogicalAnd=function(){for(var e=this.parseEquality();this.optionalOperator("&&");)e=new h.Binary("&&",e,this.parseEquality());return e},e.prototype.parseEquality=function(){for(var e=this.parseRelational();;)if(this.optionalOperator("=="))e=new h.Binary("==",e,this.parseRelational());else if(this.optionalOperator("==="))e=new h.Binary("===",e,this.parseRelational());else if(this.optionalOperator("!="))e=new h.Binary("!=",e,this.parseRelational());else{if(!this.optionalOperator("!=="))return e;e=new h.Binary("!==",e,this.parseReLine truncated
|
||||
var r=new d(l,n,null,null,t.toString());return new e(o,r,0,t,null,null,null)},e.createForEvent=function(t,n,r){var i=new d(h,r,n,null,t.toString());return new e(h,i,0,t,null,null,null)},e.createForHostEvent=function(t,n,r){var i=r.directiveIndex,o=new d(f,i.elementIndex,n,null,t.toString());return new e(f,o,i,t,null,null,r)},e}();t.BindingRecord=y},function(e,t,n){var r=n(5),i=n(36),o=function(){function e(e,t){this.elementIndex=e,this.directiveIndex=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this.elementIndex+"_"+this.directiveIndex},enumerable:!0,configurable:!0}),e}();t.DirectiveIndex=o;var s=function(){function e(e){var t=void 0===e?{}:e,n=t.directiveIndex,i=t.callAfterContentInit,o=t.callAfterContentChecked,s=t.callAfterViewInit,a=t.callAfterViewChecked,c=t.callOnChanges,u=t.callDoCheck,p=t.callOnInit,l=t.changeDetection;this.directiveIndex=n,this.callAfterContentInit=r.normalizeBool(i),this.callAfterContentChecked=r.normalizeBool(o),this.callOnChanges=r.normalizeBool(c),this.callAfterViewInit=r.normalizeBool(s),this.callAfterViewChecked=r.normalizeBool(a),this.callDoCheck=r.normalizeBool(u),this.callOnInit=r.normalizeBool(p),this.changeDetection=l}return e.prototype.isDefaultChangeDetection=function(){return i.isDefaultChangeDetectionStrategy(this.changeDetection)},e}();t.DirectiveRecord=s},function(e,t,n){var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=n(5),o=n(14),s=n(12),a=n(43),c=n(38),u=n(36),p=n(48),l=function(e){function t(t,n,r,i,o,a,c,u,p,l){e.call(this,t,n,r,i,o,a),this._records=c,this._eventBindings=u,this._directiveRecords=p,this._genConfig=l,this.directives=null;var h=c.length+1;this.values=s.ListWrapper.createFixedSize(h),this.localPipes=s.ListWrapper.createFixedSize(h),this.prevContexts=s.ListWrapper.createFixedSize(h),this.changes=s.ListWrapper.createFixedSize(h),this.dehydrateDirectives(!1)}return r(t,e),t.prototype.handleEventInternal=function(e,t,n){var r=this,i=!1;return this._matchingEventBindings(e,t).forEach(function(e){var t=r._processEventBinding(e,n);t===!1&&(i=!0)}),i},t.prototype._processEventBinding=function(e,t){var n=s.ListWrapper.createFixedSize(e.records.length);n[0]=this.values[0];for(var r=0;r<e.records.length;++r){var i=e.records[r];if(i.isSkipRecord())r+=this._computeSkipLength(r,i,n);else{var a=this._calculateCurrValue(i,n,t);if(i.lastInBinding)return this._markPathAsCheckOnce(i),a;this._writeSelf(i,a,n)}}throw new o.BaseException("Cannot be reached")},t.prototype._computeSkipLength=function(e,t,n){if(t.mode===p.RecordType.SkipRecords)return t.fixedArgs[0]-e-1;if(t.mode===p.RecordType.SkipRecordsIf){var r=this._readContext(t,n);return r?t.fixedArgs[0]-e-1:0}if(t.mode===p.RecordType.SkipRecordsIfNot){var r=this._readContext(t,n);return r?0:t.fixedArgs[0]-e-1}throw new o.BaseException("Cannot be reached")},t.prototype._markPathAsCheckOnce=function(e){if(!e.bindingRecord.isDefaultChangeDetection()){var t=e.bindingRecord.directiveRecord;this._getDetectorFor(t.directiveIndex).markPathToRootAsCheckOnce()}},t.prototype._matchingEventBindings=function(e,t){return this._eventBindings.filter(function(n){return n.eventName==e&&n.elIndex===t})},t.prototype.hydrateDirectives=function(t){if(this.values[0]=this.context,this.directives=t,this.strategy===u.ChangeDetectionStrategy.OnPushObserve)for(var n=0;n<this.directiveIndices.length;++n){var r=this.directiveIndices[n];e.prototype.observeDirective.call(this,t.getDirectiveFor(r),n)}},t.prototype.dehydrateDirectives=function(e){e&&this._destroyPipes(),this.values[0]=null,this.directives=null,s.ListWrapper.fill(this.values,c.ChangeDetectionUtil.uninitialized,1),s.ListWrapper.fill(this.changes,!1),s.ListWrapper.fill(this.localPipes,null),s.ListWrapper.fill(this.prevContexts,c.ChangeDetectionUtil.uninitialized)},t.prototype._destroyPipes=function(){for(var e=0;e<this.localPipes.length;++e)i.isPresent(this.localPipes[e])&&c.ChangeDetectionUtil.callPipeOnDestroy(this.localPipes[e])},t.prototype.checkNoChanges=function(){this.runDetectChanges(!0)},t.prototype.detectChangesInRecordsInternal=function(e){for(var t=this._records,n=null,r=!1,o=0;o<t.length;++o){var s=t[o],a=s.bindingRecord,c=a.directiveRecord;if(this._firstInBinding(s)&&(this.propertyBindingIndex=s.propertyBindingIndex),s.isLifeCycleRecord())"DoCheck"!==s.name||e?"OnInit"!==s.name||e||this.state!=u.ChangeDetectorState.NeverChecked?"OnChanges"===s.name&&i.isPresent(n)&&!e&&this._getDirectiveFor(c.directiveIndex).ngOnChanges(n):this._getDirectiveFor(c.directiveIndex).ngOnInit():this._getDirectiveFor(c.directiveIndex).ngDoCheck();else if(s.isSkipRecord())o+=this._computeSkipLength(o,s,this.values);else{var p=this._check(s,e,this.values,this.locals);i.isPresent(p)&&(this._updateDirectiveOrElement(p,a),r=!0,n=this._addChange(a,p,n))}s.lastInDirective&&(n=null,r&&!a.isDefaultChangeDetection()&&this._getDetLine truncated
|
||||
if(e.isPureFunction()){var a=e.args.map(function(e){return t._names.getChangeName(e)}).join(" || ");return e.isUsedByOtherRecord()?"if ("+a+") { "+s+" } else { "+r+" = "+n+"; }":"if ("+a+") { "+s+" }"}return s},e.prototype._genChangeMarker=function(e){return e.argumentToPureFunction?this._names.getChangeName(e.selfIndex)+" = true":""},e.prototype._genUpdateDirectiveOrElement=function(e){if(!e.lastInBinding)return"";var t=this._names.getLocalName(e.selfIndex),n=this._names.getFieldName(e.selfIndex),r=this.genConfig.logBindingUpdate?"this.logBindingUpdate("+t+");":"",i=e.bindingRecord;if(i.target.isDirective()){var o=this._names.getDirectiveName(i.directiveRecord.directiveIndex)+"."+i.target.name;return"\n "+this._genThrowOnChangeCheck(n,t)+"\n "+o+" = "+t+";\n "+r+"\n "+d+" = true;\n "}return"\n "+this._genThrowOnChangeCheck(n,t)+"\n this.notifyDispatcher("+t+");\n "+r+"\n "},e.prototype._genThrowOnChangeCheck=function(e,t){return r.assertionsEnabled()?"\n if(throwOnChange) {\n this.throwOnChangeError("+e+", "+t+");\n }\n ":""},e.prototype._genAddToChanges=function(e){var t=this._names.getLocalName(e.selfIndex),n=this._names.getFieldName(e.selfIndex);return e.bindingRecord.callOnChanges()?y+" = this.addChange("+y+", "+n+", "+t+");":""},e.prototype._maybeFirstInBinding=function(e){var t=a.ChangeDetectionUtil.protoByIndex(this.records,e.selfIndex-1),n=r.isBlank(t)||t.bindingRecord!==e.bindingRecord;return n&&!e.bindingRecord.isDirectiveLifecycle()?this._names.getPropertyBindingIndex()+" = "+e.propertyBindingIndex+";":""},e.prototype._maybeGenLastInDirective=function(e){return e.lastInDirective?"\n "+y+" = null;\n "+this._genNotifyOnPushDetectors(e)+"\n "+d+" = false;\n ":""},e.prototype._genOnCheck=function(e){var t=e.bindingRecord;return"if (!throwOnChange) "+this._names.getDirectiveName(t.directiveRecord.directiveIndex)+".ngDoCheck();"},e.prototype._genOnInit=function(e){var t=e.bindingRecord;return"if (!throwOnChange && "+this._names.getStateName()+" === "+this.changeDetectorStateVarName+".NeverChecked) "+this._names.getDirectiveName(t.directiveRecord.directiveIndex)+".ngOnInit();"},e.prototype._genOnChange=function(e){var t=e.bindingRecord;return"if (!throwOnChange && "+y+") "+this._names.getDirectiveName(t.directiveRecord.directiveIndex)+".ngOnChanges("+y+");"},e.prototype._genNotifyOnPushDetectors=function(e){var t=e.bindingRecord;if(!e.lastInDirective||t.isDefaultChangeDetection())return"";var n="\n if("+d+") {\n "+this._names.getDetectorName(t.directiveRecord.directiveIndex)+".markAsCheckOnce();\n }\n ";return n},e}();t.ChangeDetectorJITGenerator=v},function(e,t,n){function r(e){return i.StringWrapper.replaceAll(e,y,"")}var i=n(5),o=n(12),s="state",a="propertyBindingIndex",c="directiveIndices",u="dispatcher",p="locals",l="mode",h="pipes",f="protos";t.CONTEXT_ACCESSOR="context",t.CONTEXT_INDEX=0;var d="this.",y=/\W/g;t.sanitizeName=r;var v=function(){function e(e,n,i,s){this._records=e,this._eventBindings=n,this._directiveRecords=i,this._utilName=s,this._sanitizedEventNames=new o.Map,this._sanitizedNames=o.ListWrapper.createFixedSize(this._records.length+1),this._sanitizedNames[t.CONTEXT_INDEX]=t.CONTEXT_ACCESSOR;for(var a=0,c=this._records.length;c>a;++a)this._sanitizedNames[a+1]=r(""+this._records[a].name+a);for(var u=0;u<n.length;++u){for(var p=n[u],l=[t.CONTEXT_ACCESSOR],a=0,c=p.records.length;c>a;++a)l.push(r(""+p.records[a].name+a+"_"+u));this._sanitizedEventNames.set(p,l)}}return e.prototype._addFieldPrefix=function(e){return""+d+e},e.prototype.getDispatcherName=function(){return this._addFieldPrefix(u)},e.prototype.getPipesAccessorName=function(){return this._addFieldPrefix(h)},e.prototype.getProtosName=function(){return this._addFieldPrefix(f)},e.prototype.getDirectivesAccessorName=function(){return this._addFieldPrefix(c)},e.prototype.getLocalsAccessorName=function(){return this._addFieldPrefix(p)},e.prototype.getStateName=function(){return this._addFieldPrefix(s)},e.prototype.getModeName=function(){return this._addFieldPrefix(l)},e.prototype.getPropertyBindingIndex=function(){return this._addFieldPrefix(a)},e.prototype.getLocalName=function(e){return"l_"+this._sanitizedNames[e]},e.prototype.getEventLocalName=function(e,t){return"l_"+this._sanitizedEventNames.get(e)[t]},e.prototype.getChangeName=function(e){return"c_"+this._sanitizedNames[e]},e.prototype.genInitLocals=function(){for(var e=[],n=[],r=0,i=this.getFieldCount();i>r;++r)if(r==t.CONTEXT_INDEX)e.push(this.getLocalName(r)+" = "+this.getFieldName(r));else{var s=this._records[r-1];if(s.argumentToPureFunction){var a=this.getChangeName(r);e.push(this.getLocalName(r)+","+a),n.push(a)}else e.push(""+this.getLocalName(r))}var c=o.ListWrapper.isEmpty(n)?"":n.join("=")+" = false;";return"var "+e.join(",")+";"+c},e.prototype.genInitEventLocals=function(){var e=this,n=[this.getLocalName(t.CONTEXT_INDEX)+" = "+this.getFieLine truncated
|
||||
t.prototype.loadAsRoot=function(e,t,n,r){var i=this;return this._compiler.compileInHost(e).then(function(o){var s=i._viewManager.createRootHostView(o,t,n),a=i._viewManager.getHostElement(s),u=i._viewManager.getComponent(a),p=function(){c.isPresent(r)&&r(),i._viewManager.destroyRootHostView(s)};return new l(a,u,e,n,p)})},t.prototype.loadIntoLocation=function(e,t,n,r){return void 0===r&&(r=null),this.loadNextToLocation(e,this._viewManager.getNamedElementInComponentView(t,n),r)},t.prototype.loadNextToLocation=function(e,t,n){var r=this;return void 0===n&&(n=null),this._compiler.compileInHost(e).then(function(i){var o=r._viewManager.getViewContainer(t),s=o.createHostView(i,o.length,n),a=r._viewManager.getHostElement(s),c=r._viewManager.getComponent(a),u=function(){var e=o.indexOf(s);-1!==e&&o.remove(e)};return new l(a,c,e,null,u)})},t=i([s.Injectable(),o("design:paramtypes",[a.Compiler,u.AppViewManager])],t)}(h);t.DynamicComponentLoader_=f},function(e,t,n){function r(e){return e instanceof d.CompiledHostTemplate}function i(e,t){return e._createProtoView(t)}var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},s=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=n(71),u=n(6),p=n(5),l=n(14),h=n(60),f=n(16),d=n(96),y=function(){function e(){}return e}();t.Compiler=y;var v=function(e){function t(t){e.call(this),this._protoViewFactory=t}return o(t,e),t.prototype.compileInHost=function(e){var t=f.reflector.annotations(e),n=t.find(r);if(p.isBlank(n))throw new l.BaseException("No precompiled template for component "+p.stringify(e)+" found");return h.PromiseWrapper.resolve(this._createProtoView(n))},t.prototype._createProtoView=function(e){return this._protoViewFactory.createHost(e).ref},t.prototype.clearCache=function(){this._protoViewFactory.clearCache()},t=s([u.Injectable(),a("design:paramtypes",[c.ProtoViewFactory])],t)}(y);t.Compiler_=v,t.internalCreateProtoView=i},function(e,t,n){function r(e,t){return e._createComponent(t)}function i(e,t,n){return e._createEmbeddedTemplate(t,n)}function o(e,t,n,r,i,o,u){var p=null,l=null;if(i>0&&(p=n[n.length-i]),d.isBlank(p)&&(i=-1),o>0){var h=n[n.length-o];d.isPresent(h)&&(l=h.protoElementInjector)}d.isBlank(l)&&(o=-1);var f=null,y=!1,v=u.directives.map(function(t){return s(e,t)});u instanceof S.BeginComponentCmd?f=v[0]:u instanceof S.EmbeddedTemplateCmd&&(y=!0);var m=null,g=u.variableNameAndValues.length>0;if(v.length>0||g||y){var _=new Map;y||(_=a(u.variableNameAndValues,v)),m=C.ProtoElementInjector.create(l,r,v,d.isPresent(f),o,_),m.attributes=c(u.attrNameAndValues,!1)}return new b.ElementBinder(r,p,i,m,f,t)}function s(e,t){var n=e.resolve(t);return C.DirectiveProvider.createFromType(t,n)}function a(e,t){for(var n=new Map,r=0;r<e.length;r+=2){var i=e[r],o=e[r+1];d.isNumber(o)?n.set(i,o):n.set(i,null)}return n}function c(e,t){for(var n=new Map,r=0;r<e.length;r+=2)t?n.set(e[r+1],e[r]):n.set(e[r],e[r+1]);return n}function u(e,t){for(var n=0;n<e.length;n++){var r=v.resolveForwardRef(e[n]);d.isArray(r)?u(r,t):t.push(r)}}function p(e,t){for(var n=0;n<e.length;n++){var r=e[n];d.isArray(r)?p(r,t):t.push(r)}return t}var l=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},h=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},f=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},d=n(5),y=n(72),v=n(6),m=n(73),g=n(74),_=n(76),b=n(79),C=n(80),P=n(92),w=n(93),R=n(94),E=n(56),O=n(95),S=n(96),D=n(72),T=n(67),A=function(){function e(e,t,n,r,i,o){this._renderer=e,this._platformPipes=t,this._directiveResolver=n,this._viewResolver=r,this._pipeResolver=i,this._appId=o,this._cache=new Map,this._nextTemplateId=0}return e.prototype.clearCache=function(){this._cache.clear()},e.prototype.createHost=function(e){var t=e.template,n=this._cache.get(t.id);if(d.isBlank(n)){var r={},i=this._appId+"-"+this._nextTemplateId++;this._renderer.registerComponentTemplate(new y.RenderComponentTemplate(t.id,i,E.ViewEncapsulation.None,t.commands,[])),n=new _.AppProtoView(t.id,t.commands,_.ViewType.HOST,!0,t.changeDetectorFactory,null,new g.ProtoPipes(r)),this._cache.seLine truncated
|
||||
},t.prototype.unlink=function(){this.remove()},t.prototype.getDirectiveAtIndex=function(e){return this._injector.getAt(e)},t.prototype.hasInstances=function(){return this._proto.hasBindings&&this.hydrated},t.prototype.getHost=function(){return this._host},t.prototype.getBoundElementIndex=function(){return this._proto.index},t.prototype.getRootViewInjectors=function(){if(!this.hydrated)return[];var e=this._preBuiltObjects.view,t=e.getNestedView(e.elementOffset+this.getBoundElementIndex());return a.isPresent(t)?t.rootElementInjectors:[]},t.prototype.ngAfterViewChecked=function(){this._queryStrategy.updateViewQueries()},t.prototype.ngAfterContentChecked=function(){this._queryStrategy.updateContentQueries()},t.prototype.traverseAndSetQueriesAsDirty=function(){for(var e=this;a.isPresent(e);)e._setQueriesAsDirty(),e=e.parent},t.prototype._setQueriesAsDirty=function(){this._queryStrategy.setContentQueriesAsDirty(),a.isPresent(this._host)&&this._host._queryStrategy.setViewQueriesAsDirty()},t}(T);t.ElementInjector=M;var B=function(){function e(){}return e.prototype.setContentQueriesAsDirty=function(){},e.prototype.setViewQueriesAsDirty=function(){},e.prototype.hydrate=function(){},e.prototype.dehydrate=function(){},e.prototype.updateContentQueries=function(){},e.prototype.updateViewQueries=function(){},e.prototype.findQuery=function(e){throw new c.BaseException("Cannot find query for directive "+e+".")},e}(),L=new B,F=function(){function e(e){var t=e._proto.protoQueryRefs;t.length>0&&(this.query0=new G(t[0],e)),t.length>1&&(this.query1=new G(t[1],e)),t.length>2&&(this.query2=new G(t[2],e))}return e.prototype.setContentQueriesAsDirty=function(){a.isPresent(this.query0)&&!this.query0.isViewQuery&&(this.query0.dirty=!0),a.isPresent(this.query1)&&!this.query1.isViewQuery&&(this.query1.dirty=!0),a.isPresent(this.query2)&&!this.query2.isViewQuery&&(this.query2.dirty=!0)},e.prototype.setViewQueriesAsDirty=function(){a.isPresent(this.query0)&&this.query0.isViewQuery&&(this.query0.dirty=!0),a.isPresent(this.query1)&&this.query1.isViewQuery&&(this.query1.dirty=!0),a.isPresent(this.query2)&&this.query2.isViewQuery&&(this.query2.dirty=!0)},e.prototype.hydrate=function(){a.isPresent(this.query0)&&this.query0.hydrate(),a.isPresent(this.query1)&&this.query1.hydrate(),a.isPresent(this.query2)&&this.query2.hydrate()},e.prototype.dehydrate=function(){a.isPresent(this.query0)&&this.query0.dehydrate(),a.isPresent(this.query1)&&this.query1.dehydrate(),a.isPresent(this.query2)&&this.query2.dehydrate()},e.prototype.updateContentQueries=function(){a.isPresent(this.query0)&&!this.query0.isViewQuery&&this.query0.update(),a.isPresent(this.query1)&&!this.query1.isViewQuery&&this.query1.update(),a.isPresent(this.query2)&&!this.query2.isViewQuery&&this.query2.update()},e.prototype.updateViewQueries=function(){a.isPresent(this.query0)&&this.query0.isViewQuery&&this.query0.update(),a.isPresent(this.query1)&&this.query1.isViewQuery&&this.query1.update(),a.isPresent(this.query2)&&this.query2.isViewQuery&&this.query2.update()},e.prototype.findQuery=function(e){if(a.isPresent(this.query0)&&this.query0.protoQueryRef.query===e)return this.query0;if(a.isPresent(this.query1)&&this.query1.protoQueryRef.query===e)return this.query1;if(a.isPresent(this.query2)&&this.query2.protoQueryRef.query===e)return this.query2;throw new c.BaseException("Cannot find query for directive "+e+".")},e.NUMBER_OF_SUPPORTED_QUERIES=3,e}(),W=function(){function e(e){this.queries=e._proto.protoQueryRefs.map(function(t){return new G(t,e)})}return e.prototype.setContentQueriesAsDirty=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.isViewQuery||(t.dirty=!0)}},e.prototype.setViewQueriesAsDirty=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.isViewQuery&&(t.dirty=!0)}},e.prototype.hydrate=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.hydrate()}},e.prototype.dehydrate=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.dehydrate()}},e.prototype.updateContentQueries=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.isViewQuery||t.update()}},e.prototype.updateViewQueries=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.isViewQuery&&t.update()}},e.prototype.findQuery=function(e){for(var t=0;t<this.queries.length;++t){var n=this.queries[t];if(n.protoQueryRef.query===e)return n}throw new c.BaseException("Cannot find query for directive "+e+".")},e}(),U=function(){function e(e,t){this.injectorStrategy=e,this._ei=t}return e.prototype.hydrate=function(){var e=this.injectorStrategy,t=e.protoStrategy;e.resetConstructionCounter(),t.provider0 instanceof I&&a.isPresent(t.keyId0)&&e.obj0===h.UNDEFINED&&(e.obj0=e.instantiateProvider(t.provider0,t.visibility0)),t.provider1 instanceof I&&a.isPresent(t.keyId1)&&e.obj1===h.UNDEFINED&&(e.obj1=e.instantiateProvider(t.provider1,t.visibility1)),t.provider2 instanceof I&&a.isPresent(t.keyId2)&&e.obj2===h.UNDEFLine truncated
|
||||
},e.prototype.reduce=function(e,t){return this._results.reduce(e,t)},e.prototype.toArray=function(){return r.ListWrapper.clone(this._results)},e.prototype[i.getSymbolIterator()]=function(){return this._results[i.getSymbolIterator()]()},e.prototype.toString=function(){return this._results.toString()},e.prototype.reset=function(e){this._results=e},e.prototype.notifyOnChanges=function(){this._emitter.emit(this)},e}();t.QueryList=s},function(e,t){t.EVENT_TARGET_SEPARATOR=":";var n=function(){function e(e,t,n){this.fieldName=e,this.eventName=t,this.isLongForm=n}return e.parse=function(n){var r=n,i=n,o=!1,s=n.indexOf(t.EVENT_TARGET_SEPARATOR);return s>-1&&(r=n.substring(0,s).trim(),i=n.substring(s+1).trim(),o=!0),new e(r,i,o)},e.prototype.getFullName=function(){return this.isLongForm?""+this.fieldName+t.EVENT_TARGET_SEPARATOR+this.eventName:this.eventName},e}();t.EventConfig=n},function(e,t,n){function r(e){return e instanceof p.DirectiveMetadata}var i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=n(6),a=n(5),c=n(14),u=n(12),p=n(3),l=n(16),h=function(){function e(){}return e.prototype.resolve=function(e){var t=l.reflector.annotations(s.resolveForwardRef(e));if(a.isPresent(t)){var n=t.find(r);if(a.isPresent(n)){var i=l.reflector.propMetadata(e);return this._mergeWithPropertyMetadata(n,i)}}throw new c.BaseException("No Directive annotation found on "+a.stringify(e))},e.prototype._mergeWithPropertyMetadata=function(e,t){var n=[],r=[],i={},o={};return u.StringMapWrapper.forEach(t,function(e,t){e.forEach(function(e){if(e instanceof p.InputMetadata&&(a.isPresent(e.bindingPropertyName)?n.push(t+": "+e.bindingPropertyName):n.push(t)),e instanceof p.OutputMetadata&&(a.isPresent(e.bindingPropertyName)?r.push(t+": "+e.bindingPropertyName):r.push(t)),e instanceof p.HostBindingMetadata&&(a.isPresent(e.hostPropertyName)?i["["+e.hostPropertyName+"]"]=t:i["["+t+"]"]=t),e instanceof p.HostListenerMetadata){var s=a.isPresent(e.args)?e.args.join(", "):"";i["("+e.eventName+")"]=t+"("+s+")"}e instanceof p.ContentChildrenMetadata&&(o[t]=e),e instanceof p.ViewChildrenMetadata&&(o[t]=e),e instanceof p.ContentChildMetadata&&(o[t]=e),e instanceof p.ViewChildMetadata&&(o[t]=e)})}),this._merge(e,n,r,i,o)},e.prototype._merge=function(e,t,n,r,i){var o=a.isPresent(e.inputs)?u.ListWrapper.concat(e.inputs,t):t,s=a.isPresent(e.outputs)?u.ListWrapper.concat(e.outputs,n):n,c=a.isPresent(e.host)?u.StringMapWrapper.merge(e.host,r):r,l=a.isPresent(e.queries)?u.StringMapWrapper.merge(e.queries,i):i;return e instanceof p.ComponentMetadata?new p.ComponentMetadata({selector:e.selector,inputs:o,outputs:s,host:c,exportAs:e.exportAs,moduleId:e.moduleId,queries:l,changeDetection:e.changeDetection,providers:e.providers,viewProviders:e.viewProviders}):new p.DirectiveMetadata({selector:e.selector,inputs:o,outputs:s,host:c,exportAs:e.exportAs,queries:l,providers:e.providers})},e=i([s.Injectable(),o("design:paramtypes",[])],e)}();t.DirectiveResolver=h},function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},o=n(6),s=n(56),a=n(23),c=n(5),u=n(14),p=n(12),l=n(16),h=function(){function e(){this._cache=new p.Map}return e.prototype.resolve=function(e){var t=this._cache.get(e);return c.isBlank(t)&&(t=this._resolve(e),this._cache.set(e,t)),t},e.prototype._resolve=function(e){var t,n;if(l.reflector.annotations(e).forEach(function(e){e instanceof s.ViewMetadata&&(n=e),e instanceof a.ComponentMetadata&&(t=e)}),!c.isPresent(t)){if(c.isBlank(n))throw new u.BaseException("No View decorator found on component '"+c.stringify(e)+"'");return n}if(c.isBlank(t.template)&&c.isBlank(t.templateUrl)&&c.isBlank(n))throw new u.BaseException("Component '"+c.stringify(e)+"' must have either 'template', 'templateUrl', or '@View' set.");if(c.isPresent(t.template)&&c.isPresent(n))this._throwMixingViewAndComponent("template",e);else if(c.isPresent(t.templateUrl)&&c.isPresent(n))this._throwMixingViewAndComponent("templateUrl",e);else if(c.isPresent(t.directives)&&c.isPresent(n))this._throwMixingViewAndComponent("directives",e);else if(c.isPresent(t.pipes)&&c.isPresent(n))this._throwMixingViewAndComponent("pipes",e);else ifLine truncated
|
||||
var t=this;e.forEachAddedItem(function(e){t._toggleClass(e.item,!0)}),e.forEachRemovedItem(function(e){t._toggleClass(e.item,!1)})},e.prototype._applyInitialClasses=function(e){var t=this;this._initialClasses.forEach(function(n){return t._toggleClass(n,!e)})},e.prototype._applyClasses=function(e,t){var n=this;o.isPresent(e)&&(o.isArray(e)?e.forEach(function(e){return n._toggleClass(e,!t)}):e instanceof Set?e.forEach(function(e){return n._toggleClass(e,!t)}):a.StringMapWrapper.forEach(e,function(e,r){e&&n._toggleClass(r,!t)}))},e.prototype._toggleClass=function(e,t){if(e=e.trim(),e.length>0)if(e.indexOf(" ")>-1)for(var n=e.split(/\s+/g),r=0,i=n.length;i>r;r++)this._renderer.setElementClass(this._ngEl,n[r],t);else this._renderer.setElementClass(this._ngEl,e,t)},e=r([s.Directive({selector:"[ngClass]",inputs:["rawClass: ngClass","initialClasses: class"]}),i("design:paramtypes",[s.IterableDiffers,s.KeyValueDiffers,s.ElementRef,s.Renderer])],e)}();t.NgClass=c},function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},o=n(2),s=n(5),a=function(){function e(e,t,n,r){this._viewContainer=e,this._templateRef=t,this._iterableDiffers=n,this._cdr=r}return Object.defineProperty(e.prototype,"ngForOf",{set:function(e){this._ngForOf=e,s.isBlank(this._differ)&&s.isPresent(e)&&(this._differ=this._iterableDiffers.find(e).create(this._cdr))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngForTemplate",{set:function(e){s.isPresent(e)&&(this._templateRef=e)},enumerable:!0,configurable:!0}),e.prototype.ngDoCheck=function(){if(s.isPresent(this._differ)){var e=this._differ.diff(this._ngForOf);s.isPresent(e)&&this._applyChanges(e)}},e.prototype._applyChanges=function(e){var t=[];e.forEachRemovedItem(function(e){return t.push(new c(e,null))}),e.forEachMovedItem(function(e){return t.push(new c(e,null))});var n=this._bulkRemove(t);e.forEachAddedItem(function(e){return n.push(new c(e,null))}),this._bulkInsert(n);for(var r=0;r<n.length;r++)this._perViewChange(n[r].view,n[r].record);for(var r=0,i=this._viewContainer.length;i>r;r++)this._viewContainer.get(r).setLocal("last",r===i-1)},e.prototype._perViewChange=function(e,t){e.setLocal("$implicit",t.item),e.setLocal("index",t.currentIndex),e.setLocal("even",t.currentIndex%2==0),e.setLocal("odd",t.currentIndex%2==1)},e.prototype._bulkRemove=function(e){e.sort(function(e,t){return e.record.previousIndex-t.record.previousIndex});for(var t=[],n=e.length-1;n>=0;n--){var r=e[n];s.isPresent(r.record.currentIndex)?(r.view=this._viewContainer.detach(r.record.previousIndex),t.push(r)):this._viewContainer.remove(r.record.previousIndex)}return t},e.prototype._bulkInsert=function(e){e.sort(function(e,t){return e.record.currentIndex-t.record.currentIndex});for(var t=0;t<e.length;t++){var n=e[t];s.isPresent(n.view)?this._viewContainer.insert(n.view,n.record.currentIndex):n.view=this._viewContainer.createEmbeddedView(this._templateRef,n.record.currentIndex)}return e},e=r([o.Directive({selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTemplate"]}),i("design:paramtypes",[o.ViewContainerRef,o.TemplateRef,o.IterableDiffers,o.ChangeDetectorRef])],e)}();t.NgFor=a;var c=function(){function e(e,t){this.record=e,this.view=t}return e}()},function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},o=n(2),s=n(5),a=function(){function e(e,t){this._viewContainer=e,this._templateRef=t,this._prevCondition=null}return Object.defineProperty(e.prototype,"ngIf",{set:function(e){!e||!s.isBlank(this._prevCondition)&&this._prevCondition?e||!s.isBlank(this._prevCondition)&&!this._prevCondition||(this._prevCondition=!1,this._viewContainer.clear()):(this._prevCondition=!0,this._viewContainer.createEmbeddedView(this._templateRef))},enumerable:!0,configurable:!0}),e=r([o.Directive({selector:"[ngIf]",inputs:["ngIf"]}),i("design:paramtypes",[o.ViewContainerRef,o.TemplateRef])],e)}();t.NgIf=a},function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(vaLine truncated
|
||||
},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=n(2),a=n(60),c=n(129),u=n(5),p=u.CONST_EXPR(new s.Provider(c.NG_VALUE_ACCESSOR,{useExisting:s.forwardRef(function(){return h}),multi:!0})),l=function(){function e(){}return e=r([s.Directive({selector:"option"}),i("design:paramtypes",[])],e)}();t.NgSelectOption=l;var h=function(){function e(e,t,n){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){},this._updateValueWhenListOfOptionsChanges(n)}return e.prototype.writeValue=function(e){this.value=e,this._renderer.setElementProperty(this._elementRef,"value",e)},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype._updateValueWhenListOfOptionsChanges=function(e){var t=this;a.ObservableWrapper.subscribe(e.changes,function(e){return t.writeValue(t.value)})},e=r([s.Directive({selector:"select[ngControl],select[ngFormControl],select[ngModel]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},bindings:[p]}),o(2,s.Query(l,{descendants:!0})),i("design:paramtypes",[s.Renderer,s.ElementRef,s.QueryList])],e)}();t.SelectControlValueAccessor=h},function(e,t){function n(e){return void 0!==e.validate?function(t){return e.validate(t)}:e}t.normalizeValidator=n},function(e,t,n){var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},a=n(5),c=n(12),u=n(60),p=n(2),l=n(128),h=n(131),f=n(129),d=n(130),y=a.CONST_EXPR(new p.Provider(l.NgControl,{useExisting:p.forwardRef(function(){return v})})),v=function(e){function t(t,n,r){e.call(this),this._validators=t,this._asyncValidators=n,this.update=new u.EventEmitter,this.valueAccessor=d.selectValueAccessor(this,r)}return r(t,e),t.prototype.ngOnChanges=function(e){this._isControlChanged(e)&&(d.setUpControl(this.form,this),this.form.updateValueAndValidity({emitEvent:!1})),d.isPropertyUpdated(e,this.viewModel)&&(this.form.updateValue(this.model),this.viewModel=this.model)},Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return d.composeValidators(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"asyncValidator",{get:function(){return d.composeAsyncValidators(this._asyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),t.prototype.viewToModelUpdate=function(e){this.viewModel=e,u.ObservableWrapper.callEmit(this.update,e)},t.prototype._isControlChanged=function(e){return c.StringMapWrapper.contains(e,"form")},t=i([p.Directive({selector:"[ngFormControl]",bindings:[y],inputs:["form: ngFormControl","model: ngModel"],outputs:["update: ngModelChange"],exportAs:"ngForm"}),s(0,p.Optional()),s(0,p.Self()),s(0,p.Inject(h.NG_VALIDATORS)),s(1,p.Optional()),s(1,p.Self()),s(1,p.Inject(h.NG_ASYNC_VALIDATORS)),s(2,p.Optional()),s(2,p.Self()),s(2,p.Inject(f.NG_VALUE_ACCESSOR)),o("design:paramtypes",[Array,Array,Array])],t)}(l.NgControl);t.NgFormControl=v},function(e,t,n){var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},a=n(5),c=n(60),u=n(2),p=n(129),l=n(128),h=n(124),f=n(131),d=n(130),y=a.CONST_EXPR(new u.Provider(l.NgControl,{useExisting:u.forwardRef(function(){return v})})),v=function(e){function t(t,n,r){e.call(this),this._validators=t,this._asyncValidators=n,this._control=new h.Control,this._added=!1,this.update=new c.EventEmitter,this.valueAccessor=d.selectValueAccessor(this,r)}return r(t,e),t.pLine truncated
|
||||
r=e.type.isHost?c+" "+O.TEMPLATE_COMMANDS_MODULE_REF+"CompiledHostTemplate("+u+")":u;var p=i(e.type);n.push(""+S.codeGenExportVariable(p)+r+";"),n.push(S.codeGenValueFn([],p,o(e.type))+";")});var u=e[0].component.type.moduleUrl;return new _.SourceModule(""+s(u),n.join("\n"))},e.prototype.compileStylesheetCodeGen=function(e,t){return this._styleCompiler.compileStylesheetCodeGen(e,t)},e.prototype._processTemplateCodeGen=function(e,t,n,r){var i=u(t),o=this._styleCompiler.compileComponentCodeGen(e.template),s=this._templateParser.parse(e.template.template,i,e.type.name),p=this._cdCompiler.compileComponentCodeGen(e.type,e.changeDetection,s),l=this._commandCompiler.compileComponentCodeGen(e,s,p.expressions,c);a(o.declarations,n),a(p.declarations,n),a(l.declarations,n),r.push([p.expressions[0],l.expression,o.expression])},e=p([g.Injectable(),l("design:paramtypes",[E.RuntimeMetadataResolver,R.TemplateNormalizer,w.TemplateParser,C.StyleCompiler,P.CommandCompiler,b.ChangeDetectionCompiler])],e)}();t.TemplateCompiler=D;var T=function(){function e(e,t){this.component=e,this.directives=t}return e}();t.NormalizedComponentWithViewDirectives=T},function(e,t,n){function r(e,t){var n=c.CssSelector.parse(t)[0].getMatchingElementTemplate();return d.create({type:new h({runtime:Object,name:"Host"+e.name,moduleUrl:e.moduleUrl,isHost:!0}),template:new f({template:n,templateUrl:"",styles:[],styleUrls:[],ngContentSelectors:[]}),changeDetection:s.ChangeDetectionStrategy.Default,inputs:[],outputs:[],host:{},lifecycleHooks:[],isComponent:!0,dynamicLoadable:!1,selector:"*"})}var i=n(5),o=n(12),s=n(25),a=n(56),c=n(154),u=n(155),p=n(89),l=/^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g,h=function(){function e(e){var t=void 0===e?{}:e,n=t.runtime,r=t.name,o=t.moduleUrl,s=t.isHost;this.runtime=n,this.name=r,this.moduleUrl=o,this.isHost=i.normalizeBool(s)}return e.fromJson=function(t){return new e({name:t.name,moduleUrl:t.moduleUrl,isHost:t.isHost})},e.prototype.toJson=function(){return{name:this.name,moduleUrl:this.moduleUrl,isHost:this.isHost}},e}();t.CompileTypeMetadata=h;var f=function(){function e(e){var t=void 0===e?{}:e,n=t.encapsulation,r=t.template,o=t.templateUrl,s=t.styles,c=t.styleUrls,u=t.ngContentSelectors;this.encapsulation=i.isPresent(n)?n:a.ViewEncapsulation.Emulated,this.template=r,this.templateUrl=o,this.styles=i.isPresent(s)?s:[],this.styleUrls=i.isPresent(c)?c:[],this.ngContentSelectors=i.isPresent(u)?u:[]}return e.fromJson=function(t){return new e({encapsulation:i.isPresent(t.encapsulation)?a.VIEW_ENCAPSULATION_VALUES[t.encapsulation]:t.encapsulation,template:t.template,templateUrl:t.templateUrl,styles:t.styles,styleUrls:t.styleUrls,ngContentSelectors:t.ngContentSelectors})},e.prototype.toJson=function(){return{encapsulation:i.isPresent(this.encapsulation)?i.serializeEnum(this.encapsulation):this.encapsulation,template:this.template,templateUrl:this.templateUrl,styles:this.styles,styleUrls:this.styleUrls,ngContentSelectors:this.ngContentSelectors}},e}();t.CompileTemplateMetadata=f;var d=function(){function e(e){var t=void 0===e?{}:e,n=t.type,r=t.isComponent,i=t.dynamicLoadable,o=t.selector,s=t.exportAs,a=t.changeDetection,c=t.inputs,u=t.outputs,p=t.hostListeners,l=t.hostProperties,h=t.hostAttributes,f=t.lifecycleHooks,d=t.template;this.type=n,this.isComponent=r,this.dynamicLoadable=i,this.selector=o,this.exportAs=s,this.changeDetection=a,this.inputs=c,this.outputs=u,this.hostListeners=p,this.hostProperties=l,this.hostAttributes=h,this.lifecycleHooks=f,this.template=d}return e.create=function(t){var n=void 0===t?{}:t,r=n.type,s=n.isComponent,a=n.dynamicLoadable,c=n.selector,p=n.exportAs,h=n.changeDetection,f=n.inputs,d=n.outputs,y=n.host,v=n.lifecycleHooks,m=n.template,g={},_={},b={};i.isPresent(y)&&o.StringMapWrapper.forEach(y,function(e,t){var n=i.RegExpWrapper.firstMatch(l,t);i.isBlank(n)?b[t]=e:i.isPresent(n[1])?_[n[1]]=e:i.isPresent(n[2])&&(g[n[2]]=e)});var C={};i.isPresent(f)&&f.forEach(function(e){var t=u.splitAtColon(e,[e,e]);C[t[0]]=t[1]});var P={};return i.isPresent(d)&&d.forEach(function(e){var t=u.splitAtColon(e,[e,e]);P[t[0]]=t[1]}),new e({type:r,isComponent:i.normalizeBool(s),dynamicLoadable:i.normalizeBool(a),selector:c,exportAs:p,changeDetection:h,inputs:C,outputs:P,hostListeners:g,hostProperties:_,hostAttributes:b,lifecycleHooks:i.isPresent(v)?v:[],template:m})},e.fromJson=function(t){return new e({isComponent:t.isComponent,dynamicLoadable:t.dynamicLoadable,selector:t.selector,exportAs:t.exportAs,type:i.isPresent(t.type)?h.fromJson(t.type):t.type,changeDetection:i.isPresent(t.changeDetection)?s.CHANGE_DETECTION_STRATEGY_VALUES[t.changeDetection]:t.changeDetection,inputs:t.inputs,outputs:t.outputs,hostListeners:t.hostListeners,hostProperties:t.hostProperties,hostAttributes:t.hostAttributes,lifecycleHooks:t.lifecycleHooks.map(function(e){return p.LIFECYCLE_HOOKS_VALUES[e]}),template:i.isPresent(t.template)?f.fromJson(t.template):t.template})},e.prototype.toJson=function(){return{isComponent:this.isComponent,dyLine truncated
|
||||
}function o(e,t,n){return function(r){return n(e,t,r)}}function s(e,t,n,r){return function(){return r.globalOn(e,t,n)}}function a(e){return u.StringWrapper.replaceAll(t.CONTENT_ATTR,v,e)}function c(e){return u.StringWrapper.replaceAll(t.HOST_ATTR,v,e)}var u=n(5),p=n(165),l=n(3),h=n(12);t.encapsulateStyles=r,t.createRenderView=i;var f=function(){function e(e,t,n){this._eventDispatcher=e,this.factory=t,this._inplaceElement=n,this._builders=[],this.globalEventAdders=[],this.boundElements=[],this.boundTextNodes=[],this.nativeShadowRoots=[],this.fragments=[],this.rootContentInsertionPoints=[],this.componentCount=0,this.isHost=u.isPresent(n)}return e.prototype.build=function(e,t){this.enqueueRootBuilder(e,t),this._build(this._builders[0])},e.prototype._build=function(e){this._builders=[],e.build(this);for(var t=this._builders,n=0;n<t.length;n++)this._build(t[n])},e.prototype.enqueueComponentBuilder=function(e){this.componentCount++,this._builders.push(new d(e,null,e.template,e.template.commands))},e.prototype.enqueueFragmentBuilder=function(e,t,n){var r=[];this.fragments.push(r),this._builders.push(new d(e,r,t,n))},e.prototype.enqueueRootBuilder=function(e,t){var n=[];this.fragments.push(n),this._builders.push(new d(null,n,e,t))},e.prototype.consumeInplaceElement=function(){var e=this._inplaceElement;return this._inplaceElement=null,e},e.prototype.addEventListener=function(e,t,n){if(u.isPresent(t)){var r=o(e,t+":"+n,this._eventDispatcher);this.globalEventAdders.push(s(t,n,r,this.factory))}else{var r=o(e,n,this._eventDispatcher);this.factory.on(this.boundElements[e],n,r)}},e}(),d=function(){function e(e,t,n,r){this.parentComponent=e,this.fragmentRootNodes=t,this.template=n,this.cmds=r;var i=u.isPresent(t)?null:e.shadowRoot;this.parentStack=[i]}return e.prototype.build=function(e){for(var t=this.cmds,n=0;n<t.length;n++)t[n].visit(this,e)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentStack[this.parentStack.length-1]},enumerable:!0,configurable:!0}),e.prototype.visitText=function(e,t){var n=t.factory.createText(e.value);return this._addChild(n,e.ngContentIndex,t),e.isBound&&t.boundTextNodes.push(n),null},e.prototype.visitNgContent=function(e,t){if(u.isPresent(this.parentComponent))if(this.parentComponent.isRoot){var n=t.factory.createRootContentInsertionPoint();this.parent instanceof y?t.factory.appendChild(this.parent.shadowRoot,n):t.factory.appendChild(this.parent,n),t.rootContentInsertionPoints.push(n)}else for(var r=this.parentComponent.project(e.index),i=0;i<r.length;i++){var o=r[i];this._addChild(o,e.ngContentIndex,t)}return null},e.prototype.visitBeginElement=function(e,t){return this.parentStack.push(this._beginElement(e,t,null)),null},e.prototype.visitEndElement=function(e){return this._endElement(),null},e.prototype.visitBeginComponent=function(e,t){var n=e.templateId,r=t.factory.resolveComponentTemplate(n),i=this._beginElement(e,t,r),o=i;r.encapsulation===l.ViewEncapsulation.Native&&(o=t.factory.createShadowRoot(i,n),t.nativeShadowRoots.push(o));var s=0===t.componentCount&&t.isHost,a=new y(i,o,s,r);return t.enqueueComponentBuilder(a),this.parentStack.push(a),null},e.prototype.visitEndComponent=function(e){return this._endElement(),null},e.prototype.visitEmbeddedTemplate=function(e,t){var n=t.factory.createTemplateAnchor(e.attrNameAndValues);return this._addChild(n,e.ngContentIndex,t),t.boundElements.push(n),e.isMerged&&t.enqueueFragmentBuilder(this.parentComponent,this.template,e.children),null},e.prototype._beginElement=function(e,t,n){var r=t.consumeInplaceElement(),i=e.attrNameAndValues,o=this.template.encapsulation===l.ViewEncapsulation.Emulated,s=u.isPresent(n)&&n.encapsulation===l.ViewEncapsulation.Emulated,p=i.length+(o?2:0)+(s?2:0);if(p>i.length){var f,d=h.ListWrapper.createFixedSize(p);for(f=0;f<i.length;f++)d[f]=i[f];o&&(d[f++]=a(this.template.shortId),d[f++]=""),s&&(d[f++]=c(n.shortId),d[f++]=""),i=d}if(u.isPresent(r)?(t.factory.mergeElement(r,i),this.fragmentRootNodes.push(r)):(r=t.factory.createElement(e.name,i),this._addChild(r,e.ngContentIndex,t)),e.isBound){var y=t.boundElements.length;t.boundElements.push(r);for(var v=0;v<e.eventTargetAndNames.length;v+=2){var m=e.eventTargetAndNames[v],g=e.eventTargetAndNames[v+1];t.addEventListener(y,m,g)}}return r},e.prototype._endElement=function(){this.parentStack.pop()},e.prototype._addChild=function(e,t,n){var r=this.parent;u.isPresent(r)?r instanceof y?r.addContentNode(t,e,n):n.factory.appendChild(r,e):this.fragmentRootNodes.push(e)},e}(),y=function(){function e(e,t,n,r){this.hostElement=e,this.shadowRoot=t,this.isRoot=n,this.template=r,this.contentNodesByNgContentIndex=[]}return e.prototype.addContentNode=function(e,t,n){if(u.isBlank(e))this.template.encapsulation===l.ViewEncapsulation.Native&&n.factory.appendChild(this.hostElement,t);else{for(;this.contentNodesByNgContentIndex.length<=e;)this.contentNodesByNgContentIndex.push([]);this.contentNodesByNgContentIndex[e].push(t)}},e.prototype.project=function(e){returnLine truncated
|
||||
},e.prototype._popElement=function(e){for(var t=this.elementStack.length-1;t>=0;t--){var n=this.elementStack[t];if(n.name==e)return u.ListWrapper.splice(this.elementStack,t,this.elementStack.length-t),!0;if(!d.getHtmlTagDefinition(n.name).closedByParent)return!1}return!1},e.prototype._consumeAttr=function(e){var t=r(e.parts[0],e.parts[1]),n=e.sourceSpan.end,i="";if(this.peek.type===h.HtmlTokenType.ATTR_VALUE){var o=this._advance();i=o.parts[0],n=o.sourceSpan.end}return new p.HtmlAttrAst(t,i,new f.ParseSourceSpan(e.sourceSpan.start,n))},e.prototype._getParentElement=function(){return this.elementStack.length>0?u.ListWrapper.last(this.elementStack):null},e.prototype._addToParent=function(e){var t=this._getParentElement();c.isPresent(t)?t.children.push(e):this.rootNodes.push(e)},e}()},function(e,t,n){function r(e,t,n){void 0===n&&(n=null);var r=[];return t.forEach(function(t){var o=t.visit(e,n);i.isPresent(o)&&r.push(o)}),r}var i=n(5),o=function(){function e(e,t){this.value=e,this.sourceSpan=t}return e.prototype.visit=function(e,t){return e.visitText(this,t)},e}();t.HtmlTextAst=o;var s=function(){function e(e,t,n){this.name=e,this.value=t,this.sourceSpan=n}return e.prototype.visit=function(e,t){return e.visitAttr(this,t)},e}();t.HtmlAttrAst=s;var a=function(){function e(e,t,n,r){this.name=e,this.attrs=t,this.children=n,this.sourceSpan=r}return e.prototype.visit=function(e,t){return e.visitElement(this,t)},e}();t.HtmlElementAst=a,t.htmlVisitAll=r},function(e,t,n){function r(e,t){return new te(new _.ParseSourceFile(e,t)).tokenize()}function i(e){var t=e===E?"EOF":m.StringWrapper.fromCharCode(e);return'Unexpected character "'+t+'"'}function o(e){return'Unknown entity "'+e+'" - use the "&#<decimal>;" or "&#x<hex>;" syntax'}function s(e){return!a(e)||e===E}function a(e){return e>=O&&T>=e||e===Z}function c(e){return a(e)||e===H||e===V||e===k||e===I||e===U}function u(e){return($>e||e>Q)&&(q>e||e>G)&&(M>e||e>L)}function p(e){return e==B||e==E||!d(e)}function l(e){return e==B||e==E||!f(e)}function h(e){return e===W||e===E}function f(e){return e>=$&&Q>=e}function d(e){return e>=$&&X>=e||e>=M&&L>=e}function y(e){for(var t,n=[],r=0;r<e.length;r++){var i=e[r];m.isPresent(t)&&t.type==C.TEXT&&i.type==C.TEXT?(t.parts[0]+=i.parts[0],t.sourceSpan.end=i.sourceSpan.end):(t=i,n.push(t))}return n}var v=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},m=n(5),g=n(12),_=n(171),b=n(172);!function(e){e[e.TAG_OPEN_START=0]="TAG_OPEN_START",e[e.TAG_OPEN_END=1]="TAG_OPEN_END",e[e.TAG_OPEN_END_VOID=2]="TAG_OPEN_END_VOID",e[e.TAG_CLOSE=3]="TAG_CLOSE",e[e.TEXT=4]="TEXT",e[e.ESCAPABLE_RAW_TEXT=5]="ESCAPABLE_RAW_TEXT",e[e.RAW_TEXT=6]="RAW_TEXT",e[e.COMMENT_START=7]="COMMENT_START",e[e.COMMENT_END=8]="COMMENT_END",e[e.CDATA_START=9]="CDATA_START",e[e.CDATA_END=10]="CDATA_END",e[e.ATTR_NAME=11]="ATTR_NAME",e[e.ATTR_VALUE=12]="ATTR_VALUE",e[e.DOC_TYPE=13]="DOC_TYPE",e[e.EOF=14]="EOF"}(t.HtmlTokenType||(t.HtmlTokenType={}));var C=t.HtmlTokenType,P=function(){function e(e,t,n){this.type=e,this.parts=t,this.sourceSpan=n}return e}();t.HtmlToken=P;var w=function(e){function t(t,n,r){e.call(this,r,t),this.tokenType=n}return v(t,e),t}(_.ParseError);t.HtmlTokenError=w;var R=function(){function e(e,t){this.tokens=e,this.errors=t}return e}();t.HtmlTokenizeResult=R,t.tokenizeHtml=r;var E=0,O=9,S=10,D=13,T=32,A=33,I=34,x=35,N=38,k=39,j=45,V=47,M=48,B=59,L=57,F=58,W=60,U=61,H=62,q=65,G=90,z=91,K=93,$=97,X=102,Q=122,J=120,Z=160,Y=/\r\n?/g,ee=function(){function e(e){this.error=e}return e}(),te=function(){function e(e){this.file=e,this.peek=-1,this.index=-1,this.line=0,this.column=-1,this.tokens=[],this.errors=[],this.input=e.content,this.inputLowercase=e.content.toLowerCase(),this.length=e.content.length,this._advance()}return e.prototype._processCarriageReturns=function(e){return m.StringWrapper.replaceAll(e,Y,"\n")},e.prototype.tokenize=function(){for(;this.peek!==E;){var e=this._getLocation();try{this._attemptChar(W)?this._attemptChar(A)?this._attemptChar(z)?this._consumeCdata(e):this._attemptChar(j)?this._consumeComment(e):this._consumeDocType(e):this._attemptChar(V)?this._consumeTagClose(e):this._consumeTagOpen(e):this._consumeText()}catch(t){if(!(t instanceof ee))throw t;this.errors.push(t.error)}}return this._beginToken(C.EOF),this._endToken([]),new R(y(this.tokens),this.errors)},e.prototype._getLocation=function(){return new _.ParseLocation(this.file,this.index,this.line,this.column)},e.prototype._beginToken=function(e,t){void 0===t&&(t=null),m.isBlank(t)&&(t=this._getLocation()),this.currentTokenStart=t,this.currentTokenType=e},e.prototype._endToken=function(e,t){void 0===t&&(t=null),m.isBlank(t)&&(t=this._getLocation());var n=new P(this.currentTokenType,e,new _.ParseSourceSpan(this.currentTokenStart,t));return this.tokens.push(n),this.currentTokenStart=null,this.currentTokenType=null,n},e.prototype._createError=fuLine truncated
|
||||
var r=t[n];if(r.supports(e))return r}throw new a.BaseException("No event manager plugin found for event "+e)},e=r([c.Injectable(),o(0,c.Inject(t.EVENT_MANAGER_PLUGINS)),i("design:paramtypes",[Array,u.NgZone])],e)}();t.EventManager=l;var h=function(){function e(){}return e.prototype.supports=function(e){return!1},e.prototype.addEventListener=function(e,t,n){throw"not implemented"},e.prototype.addGlobalEventListener=function(e,t,n){throw"not implemented"},e}();t.EventManagerPlugin=h},function(e,t,n){var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=n(178),a=n(5),c=n(12),u=n(183),p=n(6),l=["alt","control","meta","shift"],h={alt:function(e){return e.altKey},control:function(e){return e.ctrlKey},meta:function(e){return e.metaKey},shift:function(e){return e.shiftKey}},f=function(e){function t(){e.call(this)}return r(t,e),t.prototype.supports=function(e){return a.isPresent(t.parseEventName(e))},t.prototype.addEventListener=function(e,n,r){var i=t.parseEventName(n),o=t.eventCallback(e,c.StringMapWrapper.get(i,"fullKey"),r,this.manager.getZone());this.manager.getZone().runOutsideAngular(function(){s.DOM.on(e,c.StringMapWrapper.get(i,"domEventName"),o)})},t.parseEventName=function(e){var n=e.toLowerCase().split("."),r=n.shift();if(0===n.length||!a.StringWrapper.equals(r,"keydown")&&!a.StringWrapper.equals(r,"keyup"))return null;var i=t._normalizeKey(n.pop()),o="";if(l.forEach(function(e){c.ListWrapper.contains(n,e)&&(c.ListWrapper.remove(n,e),o+=e+".")}),o+=i,0!=n.length||0===i.length)return null;var s=c.StringMapWrapper.create();return c.StringMapWrapper.set(s,"domEventName",r),c.StringMapWrapper.set(s,"fullKey",o),s},t.getEventFullKey=function(e){var t="",n=s.DOM.getEventKey(e);return n=n.toLowerCase(),a.StringWrapper.equals(n," ")?n="space":a.StringWrapper.equals(n,".")&&(n="dot"),l.forEach(function(r){if(r!=n){var i=c.StringMapWrapper.get(h,r);i(e)&&(t+=r+".")}}),t+=n},t.eventCallback=function(e,n,r,i){return function(e){a.StringWrapper.equals(t.getEventFullKey(e),n)&&i.run(function(){return r(e)})}},t._normalizeKey=function(e){switch(e){case"esc":return"escape";default:return e}},t=i([p.Injectable(),o("design:paramtypes",[])],t)}(u.EventManagerPlugin);t.KeyEventsPlugin=f},function(e,t,n){var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=n(186),a=n(5),c=n(14),u=n(6),p=function(e){function t(){e.apply(this,arguments)}return r(t,e),t.prototype.supports=function(t){if(!e.prototype.supports.call(this,t))return!1;if(!a.isPresent(window.Hammer))throw new c.BaseException("Hammer.js is not loaded, can not bind "+t+" event");return!0},t.prototype.addEventListener=function(e,t,n){var r=this.manager.getZone();t=t.toLowerCase(),r.runOutsideAngular(function(){var i=new Hammer(e);i.get("pinch").set({enable:!0}),i.get("rotate").set({enable:!0}),i.on(t,function(e){r.run(function(){n(e)})})})},t=i([u.Injectable(),o("design:paramtypes",[])],t)}(s.HammerGesturesPluginCommon);t.HammerGesturesPlugin=p},function(e,t,n){var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=n(183),o=n(12),s={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0},a=function(e){function t(){e.call(this)}return r(t,e),t.prototype.supports=function(e){return e=e.toLowerCase(),o.StringMapWrapper.contains(s,e)},t}(i.EventManagerPlugin);t.HammerGesturesPluginCommon=a},function(e,t,n){var r=n(6),i=n(5);t.DOLine truncated
|
||||
},t.prototype.getTransitionEnd=function(){return o.isPresent(this._transitionEnd)?this._transitionEnd:""},t.prototype.supportsAnimation=function(){return o.isPresent(this._animationPrefix)&&o.isPresent(this._transitionEnd)},t}(s.DomAdapter);t.GenericBrowserDomAdapter=c},function(e,t,n){var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},i=n(61),o=n(5),s=n(149),a=function(e){function t(){e.apply(this,arguments)}return r(t,e),t.prototype.get=function(e){var t=i.PromiseWrapper.completer(),n=new XMLHttpRequest;return n.open("GET",e,!0),n.responseType="text",n.onload=function(){var r=o.isPresent(n.response)?n.response:n.responseText,i=1223===n.status?204:n.status;0===i&&(i=r?200:0),i>=200&&300>=i?t.resolve(r):t.reject("Failed to load "+e,null)},n.onerror=function(){t.reject("Failed to load "+e,null)},n.send(),t.promise},t}(s.XHR);t.XHRImpl=a},function(e,t,n){var r=n(5),i=n(178),o=n(2),s=function(){function e(e){this._testability=e}return e.prototype.isStable=function(){return this._testability.isStable()},e.prototype.whenStable=function(e){this._testability.whenStable(e)},e.prototype.findBindings=function(e,t,n){return this.findProviders(e,t,n)},e.prototype.findProviders=function(e,t,n){return this._testability.findBindings(e,t,n)},e}(),a=function(){function e(){}return e.init=function(){o.setTestabilityGetter(new e)},e.prototype.addToWindow=function(e){r.global.getAngularTestability=function(t,n){void 0===n&&(n=!0);var r=e.findTestabilityInTree(t,n);if(null==r)throw new Error("Could not find testability for element.");return new s(r)},r.global.getAllAngularTestabilities=function(){var t=e.getAllTestabilities();return t.map(function(e){return new s(e)})}},e.prototype.findTestabilityInTree=function(e,t,n){if(null==t)return null;var o=e.getTestability(t);return r.isPresent(o)?o:n?i.DOM.isShadowRoot(t)?this.findTestabilityInTree(e,i.DOM.getHost(t),!0):this.findTestabilityInTree(e,i.DOM.parentElement(t),!0):null},e}();t.BrowserGetTestability=a},function(e,t){function n(){}t.wtfInit=n},function(e,t,n){var r=n(178),i=function(){function e(){}return e.prototype.getTitle=function(){return r.DOM.getTitle()},e.prototype.setTitle=function(e){r.DOM.setTitle(e)},e}();t.Title=i},function(e,t,n){function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}var i=n(178);t.DOM=i.DOM,t.setRootDomAdapter=i.setRootDomAdapter,t.DomAdapter=i.DomAdapter;var o=n(188);t.DomRenderer=o.DomRenderer;var s=n(187);t.DOCUMENT=s.DOCUMENT;var a=n(196);t.SharedStylesHost=a.SharedStylesHost,t.DomSharedStylesHost=a.DomSharedStylesHost;var c=n(182);t.DomEventsPlugin=c.DomEventsPlugin;var u=n(183);t.EVENT_MANAGER_PLUGINS=u.EVENT_MANAGER_PLUGINS,t.EventManager=u.EventManager,t.EventManagerPlugin=u.EventManagerPlugin,r(n(204)),r(n(205))},function(e,t,n){var r=n(5),i=n(178),o=function(){function e(){}return e.all=function(){return function(e){return!0}},e.css=function(e){return function(t){return r.isPresent(t.nativeElement)?i.DOM.elementMatches(t.nativeElement,e):!1}},e.directive=function(e){return function(t){return t.hasDirective(e)}},e}();t.By=o},function(e,t,n){function r(e,t){c.isPresent(e)&&h.DOM.isElementNode(e)&&h.DOM.setData(e,y,t.join(m))}function i(e){var t=h.DOM.getData(e,y);return c.isPresent(t)?t.split(m).map(function(e){return c.NumberWrapper.parseInt(e,10)}):null}function o(e){var t=i(e);if(c.isPresent(t)){var n=_.get(t[0]);if(c.isPresent(n))return new d.DebugElement_(n,t[1])}return null}var s=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=n(5),u=n(12),p=n(6),l=n(86),h=n(178),f=n(72),d=n(101),y="ngid",v="ng.probe",m="#",g=new u.Map,_=new u.Map,b=0;t.inspectNativeElement=o;var C=function(){function e(e){this._renderer=e,h.DOM.setGlobalVar(v,o)}return e.prototype.onViewCreated=function(e){var t=b++;_.set(t,e),g.set(e,t);for(var n=0;n<e.elementRefs.length;n++){var i=e.elementRefs[n];r(this._renderer.getNativeElementSync(i),[t,n])}},e.prototype.onViewDestroyed=function(e){var t=g.get(e);g["delete"](e),_["delete"](t)},e=s([p.Injectable(),a("design:paramtypes",[f.Renderer])],e)}();t.DebugElementViewListener=C,t.ELEMENT_PROBE_PROVIDERS=c.CONST_EXPR([C,c.CONST_EXPR(new p.Provider(l.AppViewListener,{useExisting:C}))]),t.ELEMENT_PROBE_BINDINGS=t.ELEMENT_PROBE_PROVIDERS},function(e,t,n){function r(e){a.ng=new s.AngularTools(e)}function i(){delete a.ng}var o=n(5),s=n(207),a=o.global;t.enableDebugTools=r,t.disableDebugTools=i},function(e,t,n){var r=n(65),i=n(5),o=n(208),s=n(178),Line truncated
|
||||
c.PromiseWrapper.all(r)})},e.prototype._emitNavigationFinish=function(e){c.ObservableWrapper.callEmit(this._subject,e)},e.prototype._afterPromiseFinishNavigating=function(e){var t=this;return c.PromiseWrapper.catchError(e.then(function(e){return t._finishNavigating()}),function(e){throw t._finishNavigating(),e})},e.prototype._routerCanReuse=function(e){var t=this;return p.isBlank(this._outlet)?m:this._outlet.routerCanReuse(e.component).then(function(n){return e.component.reuse=n,n&&p.isPresent(t._childRouter)&&p.isPresent(e.child)?t._childRouter._routerCanReuse(e.child):void 0})},e.prototype._canActivate=function(e){return r(e,this._currentInstruction)},e.prototype._routerCanDeactivate=function(e){var t=this;if(p.isBlank(this._outlet))return v;var n,r=null,i=!1,o=null;return p.isPresent(e)&&(r=e.child,o=e.component,i=e.component.reuse),n=i?v:this._outlet.routerCanDeactivate(o),n.then(function(e){return 0==e?!1:p.isPresent(t._childRouter)?t._childRouter._routerCanDeactivate(r):!0})},e.prototype.commit=function(e,t){var n=this;void 0===t&&(t=!1),this._currentInstruction=e;var r=v;if(p.isPresent(this._outlet)){var i=e.component;r=i.reuse?this._outlet.reuse(i):this.deactivate(e).then(function(e){return n._outlet.activate(i)}),p.isPresent(e.child)&&(r=r.then(function(t){return p.isPresent(n._childRouter)?n._childRouter.commit(e.child):void 0}))}var o=[];return this._auxRouters.forEach(function(t,n){p.isPresent(e.auxInstruction[n])&&o.push(t.commit(e.auxInstruction[n]))}),r.then(function(e){return c.PromiseWrapper.all(o)})},e.prototype._startNavigating=function(){this.navigating=!0},e.prototype._finishNavigating=function(){this.navigating=!1},e.prototype.subscribe=function(e){return c.ObservableWrapper.subscribe(this._subject,e)},e.prototype.deactivate=function(e){var t=this,n=null,r=null;p.isPresent(e)&&(n=e.child,r=e.component);var i=v;return p.isPresent(this._childRouter)&&(i=this._childRouter.deactivate(n)),p.isPresent(this._outlet)&&(i=i.then(function(e){return t._outlet.deactivate(r)})),i},e.prototype.recognize=function(e){var t=this._getAncestorInstructions();return this.registry.recognize(e,t)},e.prototype._getAncestorInstructions=function(){for(var e=[],t=this;p.isPresent(t.parent)&&p.isPresent(t.parent._currentInstruction);)t=t.parent,e.unshift(t._currentInstruction);return e},e.prototype.renavigate=function(){return p.isBlank(this.lastNavigationAttempt)?this._currentNavigation:this.navigateByUrl(this.lastNavigationAttempt)},e.prototype.generate=function(e){var t=this._getAncestorInstructions();return this.registry.generate(e,t)},e}();t.Router=g;var _=function(e){function t(t,n,r){var i=this;e.call(this,t,null,r),this._location=n,this._locationSub=this._location.subscribe(function(e){i.recognize(e.url).then(function(t){i.navigateByInstruction(t,p.isPresent(e.pop)).then(function(n){if(!p.isPresent(e.pop)||"hashchange"==e.type){var r=t.toUrlPath(),o=t.toUrlQuery();r.length>0&&(r="/"+r),"hashchange"==e.type?t.toRootUrl()!=i._location.path()&&i._location.replaceState(r,o):i._location.go(r,o)}})})}),this.registry.configFromComponent(r),this.navigateByUrl(n.path())}return i(t,e),t.prototype.commit=function(t,n){var r=this;void 0===n&&(n=!1);var i=t.toUrlPath(),o=t.toUrlQuery();i.length>0&&(i="/"+i);var s=e.prototype.commit.call(this,t);return n||(s=s.then(function(e){r._location.go(i,o)})),s},t.prototype.dispose=function(){p.isPresent(this._locationSub)&&(c.ObservableWrapper.dispose(this._locationSub),this._locationSub=null)},t=o([h.Injectable(),a(2,h.Inject(f.ROUTER_PRIMARY_COMPONENT)),s("design:paramtypes",[f.RouteRegistry,d.Location,p.Type])],t)}(g);t.RootRouter=_;var b=function(e){function t(t,n){e.call(this,t.registry,t,n),this.parent=t}return i(t,e),t.prototype.navigateByUrl=function(e,t){return void 0===t&&(t=!1),this.parent.navigateByUrl(e,t)},t.prototype.navigateByInstruction=function(e,t){return void 0===t&&(t=!1),this.parent.navigateByInstruction(e,t)},t}(g)},function(e,t,n){function r(e){return e.reduce(function(e,t){if(l.isString(t)){var n=t;return e.concat(n.split("/"))}return e.push(t),e},[])}function i(e){return u.ListWrapper.maximum(e,function(e){return e.specificity})}function o(e,t){if(l.isType(e)){var n=f.reflector.annotations(e);if(l.isPresent(n))for(var r=0;r<n.length;r++){var i=n[r];if(i instanceof y.RouteConfig)throw new h.BaseException('Child routes are not allowed for "'+t+'". Use "..." on the parent\'s route path.')}}}var s=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},u=n(12),p=n(60),Line truncated
|
||||
var t=this;this.platformStrategy=e,this._subject=new u.EventEmitter;var n=this.platformStrategy.getBaseHref();this._baseHref=o(i(n)),this.platformStrategy.onPopState(function(e){u.ObservableWrapper.callEmit(t._subject,{url:t.path(),pop:!0,type:e.type})})}return e.prototype.path=function(){return this.normalize(this.platformStrategy.path())},e.prototype.normalize=function(e){return o(r(this._baseHref,i(e)))},e.prototype.prepareExternalUrl=function(e){return e.length>0&&!e.startsWith("/")&&(e="/"+e),this.platformStrategy.prepareExternalUrl(e)},e.prototype.go=function(e,t){void 0===t&&(t=""),this.platformStrategy.pushState(null,"",e,t)},e.prototype.replaceState=function(e,t){void 0===t&&(t=""),this.platformStrategy.replaceState(null,"",e,t)},e.prototype.forward=function(){this.platformStrategy.forward()},e.prototype.back=function(){this.platformStrategy.back()},e.prototype.subscribe=function(e,t,n){return void 0===t&&(t=null),void 0===n&&(n=null),u.ObservableWrapper.subscribe(this._subject,e,t,n)},e=s([p.Injectable(),a("design:paramtypes",[c.LocationStrategy])],e)}();t.Location=l},function(e,t,n){function r(e){return e.length>0&&"?"!=e.substring(0,1)?"?"+e:e}function i(e,t){if(0==e.length)return t;if(0==t.length)return e;var n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t}var o=n(5),s=n(2),a=function(){function e(){}return e}();t.LocationStrategy=a,t.APP_BASE_HREF=o.CONST_EXPR(new s.OpaqueToken("appBaseHref")),t.normalizeQueryParams=r,t.joinWithSlash=i},function(e,t,n){function r(e,t){return t instanceof o.Type?e.name in t.prototype:!1}function i(e){for(var t=a.reflector.annotations(e),n=0;n<t.length;n+=1){var r=t[n];if(r instanceof s.CanActivate)return r.fn}return null}var o=n(5),s=n(240),a=n(16);t.hasLifecycleHook=r,t.getCanActivateHook=i},function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},o=n(5),s=function(){function e(e){this.name=e}return e=r([o.CONST(),i("design:paramtypes",[String])],e)}();t.RouteLifecycleHook=s;var a=function(){function e(e){this.fn=e}return e=r([o.CONST(),i("design:paramtypes",[Function])],e)}();t.CanActivate=a,t.routerCanReuse=o.CONST_EXPR(new s("routerCanReuse")),t.routerCanDeactivate=o.CONST_EXPR(new s("routerCanDeactivate")),t.routerOnActivate=o.CONST_EXPR(new s("routerOnActivate")),t.routerOnReuse=o.CONST_EXPR(new s("routerOnReuse")),t.routerOnDeactivate=o.CONST_EXPR(new s("routerOnDeactivate"))},function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,s=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(3>o?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},i=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},o=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}},s=n(60),a=n(12),c=n(5),u=n(14),p=n(2),l=n(225),h=n(229),f=n(242),d=n(239),y=s.PromiseWrapper.resolve(!0),v=function(){function e(e,t,n,r){this._elementRef=e,this._loader=t,this._parentRouter=n,this.name=null,this._componentRef=null,this._currentInstruction=null,c.isPresent(r)?(this.name=r,this._parentRouter.registerAuxOutlet(this)):this._parentRouter.registerPrimaryOutlet(this)}return e.prototype.activate=function(e){var t=this,n=this._currentInstruction;this._currentInstruction=e;var r=e.componentType,i=this._parentRouter.childRouter(r),o=p.Injector.resolve([p.provide(h.RouteData,{useValue:e.routeData}),p.provide(h.RouteParams,{useValue:new h.RouteParams(e.params)}),p.provide(l.Router,{useValue:i})]);return this._loader.loadNextToLocation(r,this._elementRef,o).then(function(i){return t._componentRef=i,d.hasLifecycleHook(f.routerOnActivate,r)?t._componentRef.instance.routerOnActivate(e,n):void 0})},e.prototype.reuse=function(e){var t=this._currentInstruction;if(this._currentInstruction=e,c.isBlank(this._componentRef))throw new u.BaseException("Cannot reuse an outlet that does not contain a component.");return s.PromiseWrapper.resolve(d.hasLifecycleHook(f.routerOnReuse,this._currentInstruction.componentType)?this._componentRef.instance.routerOnReuse(e,t):!0)},e.prototype.deactivate=function(e){var t=this,n=y;return c.isPresent(this._componentRef)&&c.isPresent(this._currentInstruction)&&d.hasLifecycleHook(f.routerOnDeactivate,this._currentInstruction.componentType)&&(n=s.PromiseWrapper.resolve(this._componentRef.instance.routerOnDeactLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
!function e(t,n,r){function o(u,a){if(!n[u]){if(!t[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(i)return i(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(e,t,n){(function(t){"use strict";var n=e("../core"),r=e("../microtask"),o=e("../patch/browser"),i=e("es6-promise");t.Zone&&console.warn("Zone already exported on window the object!"),t.Zone=r.addMicrotaskSupport(n.Zone),t.zone=new t.Zone,t.Promise=i.Promise,o.apply()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../core":2,"../microtask":4,"../patch/browser":5,"es6-promise":17}],2:[function(e,t,n){(function(n){"use strict";function r(e,t){var n=arguments.length?Object.create(e):this;return n.parent=e||null,Object.keys(t||{}).forEach(function(r){var o=r.substr(1);"$"===r[0]?n[o]=t[r](e[o]||function(){}):"+"===r[0]?e[o]?n[o]=function(){var n=e[o].apply(this,arguments);return t[r].apply(this,arguments),n}:n[o]=t[r]:"-"===r[0]?e[o]?n[o]=function(){return t[r].apply(this,arguments),e[o].apply(this,arguments)}:n[o]=t[r]:n[r]="object"==typeof t[r]?JSON.parse(JSON.stringify(t[r])):t[r]}),n.$id=r.nextId++,n}var o=e("./keys");r.prototype={constructor:r,fork:function(e){return this.onZoneCreated(),new r(this,e)},bind:function(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);t||this.enqueueTask(e);var n=this.isRootZone()?this:this.fork();return function(){return n.run(e,this,arguments)}},bindOnce:function(e){var t=this;return this.bind(function(){var n=e.apply(this,arguments);return t.dequeueTask(e),n})},isRootZone:function(){return null===this.parent},run:function(e,t,r){r=r||[];var o=n.zone;n.zone=this;try{return this.beforeTask(),e.apply(t,r)}catch(i){if(!this.onError)throw i;this.onError(i)}finally{this.afterTask(),n.zone=o}},onError:null,beforeTask:function(){},onZoneCreated:function(){},afterTask:function(){},enqueueTask:function(){},dequeueTask:function(){},addEventListener:function(){return this[o.common.addEventListener].apply(this,arguments)},removeEventListener:function(){return this[o.common.removeEventListener].apply(this,arguments)}},r.nextId=1,r.bindPromiseFn=e("./patch/promise").bindPromiseFn,t.exports={Zone:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./keys":3,"./patch/promise":12}],3:[function(e,t,n){function r(e){return"_zone$"+e}var o={addEventListener:r("addEventListener"),removeEventListener:r("removeEventListener")};t.exports={create:r,common:o}},{}],4:[function(e,t,n){(function(n){"use strict";function r(e){s._asap(this.bind(e))}function o(e){return e.prototype.scheduleMicrotask=r,e}var i,u="undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]"),a=n.navigator&&n.navigator.userAgent.toLowerCase().indexOf("firefox")>-1;u&&!a&&(i=Promise.resolve());var s=e("es6-promise").Promise;i&&s._setScheduler(function(e){i.then(e)}),s._setAsap(function(e,t){n.zone.scheduleMicrotask(function(){e(t)})}),t.exports={addMicrotaskSupport:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"es6-promise":17}],5:[function(e,t,n){(function(n){"use strict";function r(){o.patchSetClearFunction(n,["timeout","interval","immediate"]),o.patchRequestAnimationFrame(n,["requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame"]),o.patchFunction(n,["alert","prompt"]),c.apply(),f.apply(),i.apply(),u.patchClass("MutationObserver"),u.patchClass("WebKitMutationObserver"),a.apply(),s.apply(),p.apply(),l.apply()}var o=e("./functions"),i=e("./promise"),u=e("./mutation-observer"),a=e("./define-property"),s=e("./register-element"),c=(e("./websocket"),e("./event-target")),f=e("./property-descriptor"),p=e("./geolocation"),l=e("./file-reader");t.exports={apply:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./define-property":6,"./event-target":7,"./file-reader":8,"./functions":9,"./geolocation":10,"./mutation-observer":11,"./promise":12,"./property-descriptor":13,"./register-element":14,"./websocket":15}],6:[function(e,t,n){"use strict";function r(){Object.defineProperty=function(e,t,n){if(i(e,t))throw new TypeError("Cannot assign to read only property '"+t+"' of "+e);return"prototype"!==t&&(n=u(e,t,n)),s(e,t,n)},Object.defineProperties=function(e,t){return Object.keys(t).forEach(function(n){Object.defineProperty(e,n,t[n])}),e},Object.create=function(e,t){return"object"==typeof t&&Object.keys(t).forEach(function(n){t[n]=u(e,n,t[n])}),f(e,t)},Object.getOwnPropertyDescriptor=function(e,t){var n=c(e,t);return i(e,t)&&(n.configurable=!1),n}}function o(Line truncated
|
||||
+63
-20
@@ -1,4 +1,3 @@
|
||||
/* */
|
||||
"format register";
|
||||
System.register("angular2/src/facade/lang", [], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
@@ -34,19 +33,19 @@ System.register("angular2/src/facade/lang", [], true, function(require, exports,
|
||||
exports.getTypeNameForDebugging = getTypeNameForDebugging;
|
||||
exports.Math = _global.Math;
|
||||
exports.Date = _global.Date;
|
||||
var _devMode = !!_global.angularDevMode;
|
||||
var _devModeLocked = false;
|
||||
function lockDevMode() {
|
||||
_devModeLocked = true;
|
||||
var _devMode = true;
|
||||
var _modeLocked = false;
|
||||
function lockMode() {
|
||||
_modeLocked = true;
|
||||
}
|
||||
exports.lockDevMode = lockDevMode;
|
||||
function enableDevMode() {
|
||||
if (_devModeLocked) {
|
||||
throw 'Cannot enable dev mode after platform setup.';
|
||||
exports.lockMode = lockMode;
|
||||
function enableProdMode() {
|
||||
if (_modeLocked) {
|
||||
throw 'Cannot enable prod mode after platform setup.';
|
||||
}
|
||||
_devMode = true;
|
||||
_devMode = false;
|
||||
}
|
||||
exports.enableDevMode = enableDevMode;
|
||||
exports.enableProdMode = enableProdMode;
|
||||
function assertionsEnabled() {
|
||||
return _devMode;
|
||||
}
|
||||
@@ -5474,12 +5473,12 @@ System.register("angular2/src/core/util", ["angular2/src/core/util/decorators"],
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/dev_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/prod_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
exports.enableDevMode = lang_1.enableDevMode;
|
||||
exports.enableProdMode = lang_1.enableProdMode;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
@@ -7296,6 +7295,41 @@ System.register("angular2/src/core/linker/template_commands", ["angular2/src/fac
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/console", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
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 di_1 = require("angular2/src/core/di");
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
var Console = (function() {
|
||||
function Console() {}
|
||||
Console.prototype.log = function(message) {
|
||||
lang_1.print(message);
|
||||
};
|
||||
Console = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], Console);
|
||||
return Console;
|
||||
})();
|
||||
exports.Console = Console;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/zone", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
@@ -7577,12 +7611,13 @@ System.register("angular2/src/core/debug/debug_element", ["angular2/src/facade/l
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/platform_common_providers", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/platform_common_providers", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/console", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
var di_1 = require("angular2/src/core/di");
|
||||
var console_1 = require("angular2/src/core/console");
|
||||
var reflection_1 = require("angular2/src/core/reflection/reflection");
|
||||
var testability_1 = require("angular2/src/core/testability/testability");
|
||||
function _reflector() {
|
||||
@@ -7591,7 +7626,7 @@ System.register("angular2/src/core/platform_common_providers", ["angular2/src/fa
|
||||
exports.PLATFORM_COMMON_PROVIDERS = lang_1.CONST_EXPR([new di_1.Provider(reflection_1.Reflector, {
|
||||
useFactory: _reflector,
|
||||
deps: []
|
||||
}), testability_1.TestabilityRegistry]);
|
||||
}), testability_1.TestabilityRegistry, console_1.Console]);
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
@@ -14604,7 +14639,7 @@ System.register("angular2/src/facade/facade", ["angular2/src/facade/lang", "angu
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/profile/profile", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/console", "angular2/src/core/profile/profile", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
@@ -14627,6 +14662,7 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader");
|
||||
var exceptions_1 = require("angular2/src/facade/exceptions");
|
||||
var view_ref_1 = require("angular2/src/core/linker/view_ref");
|
||||
var console_1 = require("angular2/src/core/console");
|
||||
var profile_1 = require("angular2/src/core/profile/profile");
|
||||
var lang_2 = require("angular2/src/facade/lang");
|
||||
function _componentProviders(appComponentType) {
|
||||
@@ -14660,7 +14696,7 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
var _platform;
|
||||
var _platformProviders;
|
||||
function platform(providers) {
|
||||
lang_2.lockDevMode();
|
||||
lang_2.lockMode();
|
||||
if (lang_1.isPresent(_platform)) {
|
||||
if (collection_1.ListWrapper.equals(_platformProviders, providers)) {
|
||||
return _platform;
|
||||
@@ -14893,7 +14929,12 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
completer.reject(e, e.stack);
|
||||
}
|
||||
});
|
||||
return completer.promise;
|
||||
return completer.promise.then(function(_) {
|
||||
var c = _this._injector.get(console_1.Console);
|
||||
var modeDescription = lang_1.assertionsEnabled() ? "in the development mode. Call enableProdMode() to enable the production mode." : "in the production mode. Call enableDevMode() to enable the development mode.";
|
||||
c.log("Angular 2 is running " + modeDescription);
|
||||
return _;
|
||||
});
|
||||
};
|
||||
ApplicationRef_.prototype._loadComponent = function(ref) {
|
||||
var appChangeDetector = view_ref_1.internalView(ref.hostView).changeDetector;
|
||||
@@ -14969,7 +15010,7 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/dev_mode", "angular2/src/core/di", "angular2/src/facade/facade", "angular2/src/core/application_ref", "angular2/src/core/application_tokens", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/debug/debug_element", "angular2/src/core/testability/testability", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/platform_common_providers", "angular2/src/core/application_common_providers", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) {
|
||||
System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/prod_mode", "angular2/src/core/di", "angular2/src/facade/facade", "angular2/src/facade/lang", "angular2/src/core/application_ref", "angular2/src/core/application_tokens", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/debug/debug_element", "angular2/src/core/testability/testability", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/platform_common_providers", "angular2/src/core/application_common_providers", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
@@ -14980,9 +15021,11 @@ System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/co
|
||||
}
|
||||
__export(require("angular2/src/core/metadata"));
|
||||
__export(require("angular2/src/core/util"));
|
||||
__export(require("angular2/src/core/dev_mode"));
|
||||
__export(require("angular2/src/core/prod_mode"));
|
||||
__export(require("angular2/src/core/di"));
|
||||
__export(require("angular2/src/facade/facade"));
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
exports.enableProdMode = lang_1.enableProdMode;
|
||||
var application_ref_1 = require("angular2/src/core/application_ref");
|
||||
exports.platform = application_ref_1.platform;
|
||||
exports.createNgZone = application_ref_1.createNgZone;
|
||||
+63
-20
@@ -1,4 +1,3 @@
|
||||
/* */
|
||||
"format register";
|
||||
System.register("angular2/src/facade/lang", [], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
@@ -34,19 +33,19 @@ System.register("angular2/src/facade/lang", [], true, function(require, exports,
|
||||
exports.getTypeNameForDebugging = getTypeNameForDebugging;
|
||||
exports.Math = _global.Math;
|
||||
exports.Date = _global.Date;
|
||||
var _devMode = !!_global.angularDevMode;
|
||||
var _devModeLocked = false;
|
||||
function lockDevMode() {
|
||||
_devModeLocked = true;
|
||||
var _devMode = true;
|
||||
var _modeLocked = false;
|
||||
function lockMode() {
|
||||
_modeLocked = true;
|
||||
}
|
||||
exports.lockDevMode = lockDevMode;
|
||||
function enableDevMode() {
|
||||
if (_devModeLocked) {
|
||||
throw 'Cannot enable dev mode after platform setup.';
|
||||
exports.lockMode = lockMode;
|
||||
function enableProdMode() {
|
||||
if (_modeLocked) {
|
||||
throw 'Cannot enable prod mode after platform setup.';
|
||||
}
|
||||
_devMode = true;
|
||||
_devMode = false;
|
||||
}
|
||||
exports.enableDevMode = enableDevMode;
|
||||
exports.enableProdMode = enableProdMode;
|
||||
function assertionsEnabled() {
|
||||
return _devMode;
|
||||
}
|
||||
@@ -5474,12 +5473,12 @@ System.register("angular2/src/core/util", ["angular2/src/core/util/decorators"],
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/dev_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/prod_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
exports.enableDevMode = lang_1.enableDevMode;
|
||||
exports.enableProdMode = lang_1.enableProdMode;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
@@ -7296,6 +7295,41 @@ System.register("angular2/src/core/linker/template_commands", ["angular2/src/fac
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/console", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
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 di_1 = require("angular2/src/core/di");
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
var Console = (function() {
|
||||
function Console() {}
|
||||
Console.prototype.log = function(message) {
|
||||
lang_1.print(message);
|
||||
};
|
||||
Console = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], Console);
|
||||
return Console;
|
||||
})();
|
||||
exports.Console = Console;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/zone", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
@@ -7577,12 +7611,13 @@ System.register("angular2/src/core/debug/debug_element", ["angular2/src/facade/l
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/platform_common_providers", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/platform_common_providers", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/console", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
var di_1 = require("angular2/src/core/di");
|
||||
var console_1 = require("angular2/src/core/console");
|
||||
var reflection_1 = require("angular2/src/core/reflection/reflection");
|
||||
var testability_1 = require("angular2/src/core/testability/testability");
|
||||
function _reflector() {
|
||||
@@ -7591,7 +7626,7 @@ System.register("angular2/src/core/platform_common_providers", ["angular2/src/fa
|
||||
exports.PLATFORM_COMMON_PROVIDERS = lang_1.CONST_EXPR([new di_1.Provider(reflection_1.Reflector, {
|
||||
useFactory: _reflector,
|
||||
deps: []
|
||||
}), testability_1.TestabilityRegistry]);
|
||||
}), testability_1.TestabilityRegistry, console_1.Console]);
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
@@ -14604,7 +14639,7 @@ System.register("angular2/src/facade/facade", ["angular2/src/facade/lang", "angu
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/profile/profile", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/console", "angular2/src/core/profile/profile", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
@@ -14627,6 +14662,7 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader");
|
||||
var exceptions_1 = require("angular2/src/facade/exceptions");
|
||||
var view_ref_1 = require("angular2/src/core/linker/view_ref");
|
||||
var console_1 = require("angular2/src/core/console");
|
||||
var profile_1 = require("angular2/src/core/profile/profile");
|
||||
var lang_2 = require("angular2/src/facade/lang");
|
||||
function _componentProviders(appComponentType) {
|
||||
@@ -14660,7 +14696,7 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
var _platform;
|
||||
var _platformProviders;
|
||||
function platform(providers) {
|
||||
lang_2.lockDevMode();
|
||||
lang_2.lockMode();
|
||||
if (lang_1.isPresent(_platform)) {
|
||||
if (collection_1.ListWrapper.equals(_platformProviders, providers)) {
|
||||
return _platform;
|
||||
@@ -14893,7 +14929,12 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
completer.reject(e, e.stack);
|
||||
}
|
||||
});
|
||||
return completer.promise;
|
||||
return completer.promise.then(function(_) {
|
||||
var c = _this._injector.get(console_1.Console);
|
||||
var modeDescription = lang_1.assertionsEnabled() ? "in the development mode. Call enableProdMode() to enable the production mode." : "in the production mode. Call enableDevMode() to enable the development mode.";
|
||||
c.log("Angular 2 is running " + modeDescription);
|
||||
return _;
|
||||
});
|
||||
};
|
||||
ApplicationRef_.prototype._loadComponent = function(ref) {
|
||||
var appChangeDetector = view_ref_1.internalView(ref.hostView).changeDetector;
|
||||
@@ -14969,7 +15010,7 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/dev_mode", "angular2/src/core/di", "angular2/src/facade/facade", "angular2/src/core/application_ref", "angular2/src/core/application_tokens", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/debug/debug_element", "angular2/src/core/testability/testability", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/platform_common_providers", "angular2/src/core/application_common_providers", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) {
|
||||
System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/prod_mode", "angular2/src/core/di", "angular2/src/facade/facade", "angular2/src/facade/lang", "angular2/src/core/application_ref", "angular2/src/core/application_tokens", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/debug/debug_element", "angular2/src/core/testability/testability", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/platform_common_providers", "angular2/src/core/application_common_providers", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
@@ -14980,9 +15021,11 @@ System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/co
|
||||
}
|
||||
__export(require("angular2/src/core/metadata"));
|
||||
__export(require("angular2/src/core/util"));
|
||||
__export(require("angular2/src/core/dev_mode"));
|
||||
__export(require("angular2/src/core/prod_mode"));
|
||||
__export(require("angular2/src/core/di"));
|
||||
__export(require("angular2/src/facade/facade"));
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
exports.enableProdMode = lang_1.enableProdMode;
|
||||
var application_ref_1 = require("angular2/src/core/application_ref");
|
||||
exports.platform = application_ref_1.platform;
|
||||
exports.createNgZone = application_ref_1.createNgZone;
|
||||
@@ -0,0 +1,19 @@
|
||||
"format register";System.register("angular2/src/facade/lang",[],!0,function(e,t,r){function n(e){return e.name}function i(){M=!0}function o(){if(M)throw"Cannot enable prod mode after platform setup.";j=!1}function a(){return j}function s(e){return e}function c(){return function(e){return e}}function l(e){return void 0!==e&&null!==e}function u(e){return void 0===e||null===e}function p(e){return"string"==typeof e}function d(e){return"function"==typeof e}function f(e){return d(e)}function h(e){return"object"==typeof e&&null!==e}function g(e){return e instanceof V.Promise}function m(e){return Array.isArray(e)}function v(e){return"number"==typeof e}function y(e){return e instanceof t.Date&&!isNaN(e.valueOf())}function _(){}function b(e){if("string"==typeof e)return e;if(void 0===e||null===e)return""+e;if(e.name)return e.name;var t=e.toString(),r=t.indexOf("\n");return-1===r?t:t.substring(0,r)}function C(e){return e}function w(e,t){return e}function P(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function E(e){return e}function S(e){return u(e)?null:e}function R(e){return u(e)?!1:e}function x(e){return null!==e&&("function"==typeof e||"object"==typeof e)}function O(e){console.log(e)}function D(e,t,r){for(var n=t.split("."),i=e;n.length>1;){var o=n.shift();i=i.hasOwnProperty(o)&&l(i[o])?i[o]:i[o]={}}(void 0===i||null===i)&&(i={}),i[n.shift()]=r}function T(){if(u(z))if(l(Symbol)&&l(Symbol.iterator))z=Symbol.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),t=0;t<e.length;++t){var r=e[t];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(z=r)}return z}var A=System.global,I=A.define;A.define=void 0;var k,N=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};k="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:A:window,t.IS_DART=!1;var V=k;t.global=V,t.Type=Function,t.getTypeNameForDebugging=n,t.Math=V.Math,t.Date=V.Date;var j=!0,M=!1;t.lockMode=i,t.enableProdMode=o,t.assertionsEnabled=a,V.assert=function(e){},t.CONST_EXPR=s,t.CONST=c,t.isPresent=l,t.isBlank=u,t.isString=p,t.isFunction=d,t.isType=f,t.isStringMap=h,t.isPromise=g,t.isArray=m,t.isNumber=v,t.isDate=y,t.noop=_,t.stringify=b,t.serializeEnum=C,t.deserializeEnum=w;var B=function(){function e(){}return e.fromCharCode=function(e){return String.fromCharCode(e)},e.charCodeAt=function(e,t){return e.charCodeAt(t)},e.split=function(e,t){return e.split(t)},e.equals=function(e,t){return e===t},e.stripLeft=function(e,t){if(e&&e.length){for(var r=0,n=0;n<e.length&&e[n]==t;n++)r++;e=e.substring(r)}return e},e.stripRight=function(e,t){if(e&&e.length){for(var r=e.length,n=e.length-1;n>=0&&e[n]==t;n--)r--;e=e.substring(0,r)}return e},e.replace=function(e,t,r){return e.replace(t,r)},e.replaceAll=function(e,t,r){return e.replace(t,r)},e.slice=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=null),e.slice(t,null===r?void 0:r)},e.replaceAllMapped=function(e,t,r){return e.replace(t,function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return e.splice(-2,2),r(e)})},e.contains=function(e,t){return-1!=e.indexOf(t)},e.compare=function(e,t){return t>e?-1:e>t?1:0},e}();t.StringWrapper=B;var L=function(){function e(e){void 0===e&&(e=[]),this.parts=e}return e.prototype.add=function(e){this.parts.push(e)},e.prototype.toString=function(){return this.parts.join("")},e}();t.StringJoiner=L;var F=function(e){function t(t){e.call(this),this.message=t}return N(t,e),t.prototype.toString=function(){return this.message},t}(Error);t.NumberParseError=F;var W=function(){function e(){}return e.toFixed=function(e,t){return e.toFixed(t)},e.equal=function(e,t){return e===t},e.parseIntAutoRadix=function(e){var t=parseInt(e);if(isNaN(t))throw new F("Invalid integer literal when parsing "+e);return t},e.parseInt=function(e,t){if(10==t){if(/^(\-|\+)?[0-9]+$/.test(e))return parseInt(e,t)}else if(16==t){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(e))return parseInt(e,t)}else{var r=parseInt(e,t);if(!isNaN(r))return r}throw new F("Invalid integer literal when parsing "+e+" in base "+t)},e.parseFloat=function(e){return parseFloat(e)},Object.defineProperty(e,"NaN",{get:function(){return NaN},enumerable:!0,configurable:!0}),e.isNaN=function(e){return isNaN(e)},e.isInteger=function(e){return Number.isInteger(e)},e}();t.NumberWrapper=W,t.RegExp=V.RegExp;var U=function(){function e(){}return e.create=function(e,t){return void 0===t&&(t=""),t=t.replace(/g/g,""),new V.RegExp(e,t+"g")},e.firstMatch=function(e,t){return e.lastIndex=0,e.exec(t)},e.test=function(e,t){return e.lastIndex=0,e.test(t)},e.matcher=function(e,t){return e.lastIndex=0,{re:e,input:t}},e}();t.RegExpWrapper=U;var H=function(){function e(){}return e.next=function(e){return e.re.exec(e.input)},e}();t.RegExpMatcherWrapper=H;var q=function(){function e(){}return e.apply=function(e,t){rLine truncated
|
||||
this.raf(function(r){l.DOM.on(t,"transitionend",function(r){var n=c.Math.round(1e3*r.elapsedTime);e.elapsedTimeIncludesDelay=2==n,l.DOM.remove(t)}),l.DOM.setStyle(t,"width","2px")},2)},e.prototype.raf=function(e,t){void 0===t&&(t=1);var r=new p(e,t);return function(){return r.cancel()}},e=o([s.Injectable(),a("design:paramtypes",[])],e)}();t.BrowserDetails=u;var p=function(){function e(e,t){this.callback=e,this.frames=t,this._raf()}return e.prototype._raf=function(){var e=this;this.currentFrameId=l.DOM.requestAnimationFrame(function(t){return e._nextFrame(t)})},e.prototype._nextFrame=function(e){this.frames--,this.frames>0?this._raf():this.callback(e)},e.prototype.cancel=function(){l.DOM.cancelAnimationFrame(this.currentFrameId),this.currentFrameId=null},e}();return n.define=i,r.exports}),System.register("angular2/src/platform/dom/dom_tokens",["angular2/src/core/di","angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/di"),a=e("angular2/src/facade/lang");return t.DOCUMENT=a.CONST_EXPR(new o.OpaqueToken("DocumentToken")),n.define=i,r.exports}),System.register("angular2/src/core/profile/wtf_impl",["angular2/src/facade/lang"],!0,function(e,t,r){function n(){var e=d.global.wtf;return e&&(u=e.trace)?(p=u.events,!0):!1}function i(e,t){return void 0===t&&(t=null),p.createScope(e,t)}function o(e,t){return u.leaveScope(e,t),t}function a(e,t){return u.beginTimeRange(e,t)}function s(e){u.endTimeRange(e)}var c=System.global,l=c.define;c.define=void 0;var u,p,d=e("angular2/src/facade/lang");return t.detectWTF=n,t.createScope=i,t.leave=o,t.startTimeRange=a,t.endTimeRange=s,c.define=l,r.exports}),System.register("angular2/src/core/metadata/di",["angular2/src/facade/lang","angular2/src/core/di","angular2/src/core/di/metadata"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/facade/lang"),l=e("angular2/src/core/di"),u=e("angular2/src/core/di/metadata"),p=function(e){function t(t){e.call(this),this.attributeName=t}return o(t,e),Object.defineProperty(t.prototype,"token",{get:function(){return this},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"@Attribute("+c.stringify(this.attributeName)+")"},t=a([c.CONST(),s("design:paramtypes",[String])],t)}(u.DependencyMetadata);t.AttributeMetadata=p;var d=function(e){function t(t,r){var n=void 0===r?{}:r,i=n.descendants,o=void 0===i?!1:i,a=n.first,s=void 0===a?!1:a;e.call(this),this._selector=t,this.descendants=o,this.first=s}return o(t,e),Object.defineProperty(t.prototype,"isViewQuery",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selector",{get:function(){return l.resolveForwardRef(this._selector)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVarBindingQuery",{get:function(){return c.isString(this.selector)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"varBindings",{get:function(){return this.selector.split(",")},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"@Query("+c.stringify(this.selector)+")"},t=a([c.CONST(),s("design:paramtypes",[Object,Object])],t)}(u.DependencyMetadata);t.QueryMetadata=d;var f=function(e){function t(t,r){var n=(void 0===r?{}:r).descendants,i=void 0===n?!1:n;e.call(this,t,{descendants:i})}return o(t,e),t=a([c.CONST(),s("design:paramtypes",[Object,Object])],t)}(d);t.ContentChildrenMetadata=f;var h=function(e){function t(t){e.call(this,t,{descendants:!0,first:!0})}return o(t,e),t=a([c.CONST(),s("design:paramtypes",[Object])],t)}(d);t.ContentChildMetadata=h;var g=function(e){function t(t,r){var n=void 0===r?{}:r,i=n.descendants,o=void 0===i?!1:i,a=n.first,s=void 0===a?!1:a;e.call(this,t,{descendants:o,first:s})}return o(t,e),Object.defineProperty(t.prototype,"isViewQuery",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"@ViewQuery("+c.stringify(this.selector)+")"},t=a([c.CONST(),s("design:paramtypes",[Object,Object])],t)}(d);t.ViewQueryMetadata=g;var m=function(e){function t(t){e.call(this,t,{descendants:!0})}return o(t,e),t=a([c.CONST(),s("design:paramtypes",[Object])],t)}(g);t.ViewChildrenMetadata=m;var v=function(e){function t(t){e.call(this,t,{descendants:!0,first:!0})}return o(t,e),t=a([c.CONST(),s("designLine truncated
|
||||
function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},b=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},C=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},w=e("angular2/src/core/di/decorators"),P=e("angular2/src/facade/collection"),E=e("angular2/src/facade/lang"),S=e("angular2/src/facade/exceptions");!function(e){e[e.Character=0]="Character",e[e.Identifier=1]="Identifier",e[e.Keyword=2]="Keyword",e[e.String=3]="String",e[e.Operator=4]="Operator",e[e.Number=5]="Number"}(t.TokenType||(t.TokenType={}));var R=t.TokenType,x=function(){function e(){}return e.prototype.tokenize=function(e){for(var t=new z(e),r=[],n=t.scanToken();null!=n;)r.push(n),n=t.scanToken();return r},e=b([w.Injectable(),C("design:paramtypes",[])],e)}();t.Lexer=x;var O=function(){function e(e,t,r,n){this.index=e,this.type=t,this.numValue=r,this.strValue=n}return e.prototype.isCharacter=function(e){return this.type==R.Character&&this.numValue==e},e.prototype.isNumber=function(){return this.type==R.Number},e.prototype.isString=function(){return this.type==R.String},e.prototype.isOperator=function(e){return this.type==R.Operator&&this.strValue==e},e.prototype.isIdentifier=function(){return this.type==R.Identifier},e.prototype.isKeyword=function(){return this.type==R.Keyword},e.prototype.isKeywordVar=function(){return this.type==R.Keyword&&"var"==this.strValue},e.prototype.isKeywordNull=function(){return this.type==R.Keyword&&"null"==this.strValue},e.prototype.isKeywordUndefined=function(){return this.type==R.Keyword&&"undefined"==this.strValue},e.prototype.isKeywordTrue=function(){return this.type==R.Keyword&&"true"==this.strValue},e.prototype.isKeywordFalse=function(){return this.type==R.Keyword&&"false"==this.strValue},e.prototype.toNumber=function(){return this.type==R.Number?this.numValue:-1},e.prototype.toString=function(){switch(this.type){case R.Character:case R.Identifier:case R.Keyword:case R.Operator:case R.String:return this.strValue;case R.Number:return this.numValue.toString();default:return null}},e}();t.Token=O,t.EOF=new O(-1,R.Character,0,""),t.$EOF=0,t.$TAB=9,t.$LF=10,t.$VTAB=11,t.$FF=12,t.$CR=13,t.$SPACE=32,t.$BANG=33,t.$DQ=34,t.$HASH=35,t.$$=36,t.$PERCENT=37,t.$AMPERSAND=38,t.$SQ=39,t.$LPAREN=40,t.$RPAREN=41,t.$STAR=42,t.$PLUS=43,t.$COMMA=44,t.$MINUS=45,t.$PERIOD=46,t.$SLASH=47,t.$COLON=58,t.$SEMICOLON=59,t.$LT=60,t.$EQ=61,t.$GT=62,t.$QUESTION=63;var D=48,T=57,A=65,I=69,k=90;t.$LBRACKET=91,t.$BACKSLASH=92,t.$RBRACKET=93;var N=94,V=95,j=97,M=101,B=102,L=110,F=114,W=116,U=117,H=118,q=122;t.$LBRACE=123,t.$BAR=124,t.$RBRACE=125;var G=160,K=function(e){function t(t){e.call(this),this.message=t}return _(t,e),t.prototype.toString=function(){return this.message},t}(S.BaseException);t.ScannerError=K;var z=function(){function e(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}return e.prototype.advance=function(){this.peek=++this.index>=this.length?t.$EOF:E.StringWrapper.charCodeAt(this.input,this.index)},e.prototype.scanToken=function(){for(var e=this.input,r=this.length,i=this.peek,o=this.index;i<=t.$SPACE;){if(++o>=r){i=t.$EOF;break}i=E.StringWrapper.charCodeAt(e,o)}if(this.peek=i,this.index=o,o>=r)return null;if(u(i))return this.scanIdentifier();if(f(i))return this.scanNumber(o);var a=o;switch(i){case t.$PERIOD:return this.advance(),f(this.peek)?this.scanNumber(a):n(a,t.$PERIOD);case t.$LPAREN:case t.$RPAREN:case t.$LBRACE:case t.$RBRACE:case t.$LBRACKET:case t.$RBRACKET:case t.$COMMA:case t.$COLON:case t.$SEMICOLON:return this.scanCharacter(a,i);case t.$SQ:case t.$DQ:return this.scanString();case t.$HASH:case t.$PLUS:case t.$MINUS:case t.$STAR:case t.$SLASH:case t.$PERCENT:case N:return this.scanOperator(a,E.StringWrapper.fromCharCode(i));case t.$QUESTION:return this.scanComplexOperator(a,"?",t.$PERIOD,".");case t.$LT:case t.$GT:return this.scanComplexOperator(a,E.StringWrapper.fromCharCode(i),t.$EQ,"=");case t.$BANG:case t.$EQ:return this.scanComplexOperator(a,E.StringWrapper.fromCharCode(i),t.$EQ,"=",t.$EQ,"=");case t.$AMPERSAND:return this.scanComplexOperator(a,"&",t.$AMPERSAND,"&");case t.$BAR:return this.scanComplexOperator(a,"|",t.$BAR,"|");case G:for(;l(this.peek);)this.advance();return this.scanToken()}return this.error("Unexpected character ["+E.StringWrapper.fromCharCode(i)+"]",0),null},e.prototype.scanCharacter=function(e,t){return assert(this.peek==t),this.advance(),n(e,t)},e.prototype.scanOperator=function(e,t){return assert(this.peek==E.StringWrapper.charCodeAt(t,0)),assert(P.SetWrapper.has($,t)),this.advance(),a(e,Line truncated
|
||||
this.fixedArgs=i,this.contextIndex=o,this.directiveIndex=a,this.selfIndex=s,this.bindingRecord=c,this.lastInBinding=l,this.lastInDirective=u,this.argumentToPureFunction=p,this.referencedBySelf=d,this.propertyBindingIndex=f}return e.prototype.isPureFunction=function(){return this.mode===o.Interpolate||this.mode===o.CollectionLiteral},e.prototype.isUsedByOtherRecord=function(){return!this.lastInBinding||this.referencedBySelf},e.prototype.shouldBeChecked=function(){return this.argumentToPureFunction||this.lastInBinding||this.isPureFunction()||this.isPipeRecord()},e.prototype.isPipeRecord=function(){return this.mode===o.Pipe},e.prototype.isConditionalSkipRecord=function(){return this.mode===o.SkipRecordsIfNot||this.mode===o.SkipRecordsIf},e.prototype.isUnconditionalSkipRecord=function(){return this.mode===o.SkipRecords},e.prototype.isSkipRecord=function(){return this.isConditionalSkipRecord()||this.isUnconditionalSkipRecord()},e.prototype.isLifeCycleRecord=function(){return this.mode===o.DirectiveLifecycle},e}();return t.ProtoRecord=a,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/event_binding",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=function(){function e(e,t,r,n){this.eventName=e,this.elIndex=t,this.dirIndex=r,this.records=n}return e}();return t.EventBinding=o,n.define=i,r.exports}),System.register("angular2/src/core/change_detection/coalesce",["angular2/src/facade/lang","angular2/src/facade/collection","angular2/src/core/change_detection/proto_record"],!0,function(e,t,r){function n(e){for(var t=[],r=[],n=new h.Map,a=0,c=h.ListWrapper.createFixedSize(e.length),l=0;l<e.length;l++){var u=c[l];f.isPresent(u)&&(a--,u.fixedArgs[0]=t.length);var p=e[l],d=s(p,t,n);if(d.isSkipRecord())t.push(d),a++,c[d.fixedArgs[0]]=d;else{var g=o(d,t,r,a>0);n.set(p.selfIndex,g.selfIndex)}}return i(t)}function i(e){for(var t=[],r=h.ListWrapper.createFixedSize(e.length),n=new h.Map,i=0;i<e.length;i++){var o=r[i];f.isPresent(o)&&(o.fixedArgs[0]=t.length);var a=e[i];if(a.isSkipRecord()){if(a.isConditionalSkipRecord()&&a.fixedArgs[0]===i+2&&i<e.length-1&&e[i+1].mode===g.RecordType.SkipRecords&&(a.mode=a.mode===g.RecordType.SkipRecordsIf?g.RecordType.SkipRecordsIfNot:g.RecordType.SkipRecordsIf,a.fixedArgs[0]=e[i+1].fixedArgs[0],i++),a.fixedArgs[0]>i+1){var c=s(a,t,n);t.push(c),r[c.fixedArgs[0]]=c}}else{var c=s(a,t,n);t.push(c),n.set(a.selfIndex,c.selfIndex)}}return t}function o(e,t,r,n){var i=a(e,t,r);return f.isPresent(i)?(e.lastInBinding?(t.push(l(e,i.selfIndex,t.length+1)),i.referencedBySelf=!0):e.argumentToPureFunction&&(i.argumentToPureFunction=!0),i):(n&&r.push(e.selfIndex),t.push(e),e)}function a(e,t,r){return t.find(function(t){return-1==r.indexOf(t.selfIndex)&&t.mode!==g.RecordType.DirectiveLifecycle&&u(t,e)&&t.mode===e.mode&&f.looseIdentical(t.funcOrValue,e.funcOrValue)&&t.contextIndex===e.contextIndex&&f.looseIdentical(t.name,e.name)&&h.ListWrapper.equals(t.args,e.args)})}function s(e,t,r){var n=e.args.map(function(e){return c(r,e)}),i=c(r,e.contextIndex),o=t.length+1;return new g.ProtoRecord(e.mode,e.name,e.funcOrValue,n,e.fixedArgs,i,e.directiveIndex,o,e.bindingRecord,e.lastInBinding,e.lastInDirective,e.argumentToPureFunction,e.referencedBySelf,e.propertyBindingIndex)}function c(e,t){var r=e.get(t);return f.isPresent(r)?r:t}function l(e,t,r){return new g.ProtoRecord(g.RecordType.Self,"self",null,[],e.fixedArgs,t,e.directiveIndex,r,e.bindingRecord,e.lastInBinding,e.lastInDirective,!1,!1,e.propertyBindingIndex)}function u(e,t){var r=f.isBlank(e.directiveIndex)?null:e.directiveIndex.directiveIndex,n=f.isBlank(e.directiveIndex)?null:e.directiveIndex.elementIndex,i=f.isBlank(t.directiveIndex)?null:t.directiveIndex.directiveIndex,o=f.isBlank(t.directiveIndex)?null:t.directiveIndex.elementIndex;return r===i&&n===o}var p=System.global,d=p.define;p.define=void 0;var f=e("angular2/src/facade/lang"),h=e("angular2/src/facade/collection"),g=e("angular2/src/core/change_detection/proto_record");return t.coalesce=n,p.define=d,r.exports}),System.register("angular2/src/core/change_detection/codegen_name_util",["angular2/src/facade/lang","angular2/src/facade/collection"],!0,function(e,t,r){function n(e){return a.StringWrapper.replaceAll(e,v,"")}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/facade/lang"),s=e("angular2/src/facade/collection"),c="state",l="propertyBindingIndex",u="directiveIndices",p="dispatcher",d="locals",f="mode",h="pipes",g="protos";t.CONTEXT_ACCESSOR="context",t.CONTEXT_INDEX=0;var m="this.",v=/\W/g;t.sanitizeName=n;var y=function(){function e(e,r,i,o){this._records=e,this._eventBindings=r,this._directiveRecords=i,this._utilName=o,this._sanitizedEventNames=new s.Map,this._sanitizedNames=s.ListWrapper.createFixedSize(this._records.length+1),this._sanitizedNames[t.CONTEXT_INDEX]=t.CONTEXT_ACCESSOR;for(var a=0,c=this._records.length;c>a;++a)this._sanitizedNames[a+1]=n(""+this._records[a].name+a);for(var l=0;l<r.length;++l){for(var u=r[l],p=[t.Line truncated
|
||||
function e(){}return e.prototype.clear=function(){for(var e=this.length-1;e>=0;e--)this.remove(e)},Object.defineProperty(e.prototype,"length",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),e}();t.ViewContainerRef=u;var p=function(e){function t(t,r){e.call(this),this.viewManager=t,this.element=r}return o(t,e),t.prototype._getViews=function(){var e=this.element,t=l.internalView(e.parentView).viewContainers[e.boundElementIndex];return c.isPresent(t)?t.views:[]},t.prototype.get=function(e){return this._getViews()[e].ref},Object.defineProperty(t.prototype,"length",{get:function(){return this._getViews().length},enumerable:!0,configurable:!0}),t.prototype.createEmbeddedView=function(e,t){return void 0===t&&(t=-1),-1==t&&(t=this.length),this.viewManager.createEmbeddedViewInContainer(this.element,t,e)},t.prototype.createHostView=function(e,t,r){return void 0===e&&(e=null),void 0===t&&(t=-1),void 0===r&&(r=null),-1==t&&(t=this.length),this.viewManager.createHostViewInContainer(this.element,t,e,r)},t.prototype.insert=function(e,t){return void 0===t&&(t=-1),-1==t&&(t=this.length),this.viewManager.attachViewInContainer(this.element,t,e)},t.prototype.indexOf=function(e){return a.ListWrapper.indexOf(this._getViews(),l.internalView(e))},t.prototype.remove=function(e){void 0===e&&(e=-1),-1==e&&(e=this.length-1),this.viewManager.destroyViewInContainer(this.element,e)},t.prototype.detach=function(e){return void 0===e&&(e=-1),-1==e&&(e=this.length-1),this.viewManager.detachViewInContainer(this.element,e)},t}(u);return t.ViewContainerRef_=p,n.define=i,r.exports}),System.register("angular2/src/core/linker/interfaces",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,function(e){e[e.OnInit=0]="OnInit",e[e.OnDestroy=1]="OnDestroy",e[e.DoCheck=2]="DoCheck",e[e.OnChanges=3]="OnChanges",e[e.AfterContentInit=4]="AfterContentInit",e[e.AfterContentChecked=5]="AfterContentChecked",e[e.AfterViewInit=6]="AfterViewInit",e[e.AfterViewChecked=7]="AfterViewChecked"}(t.LifecycleHooks||(t.LifecycleHooks={}));var o=t.LifecycleHooks;return t.LIFECYCLE_HOOKS_VALUES=[o.OnInit,o.OnDestroy,o.DoCheck,o.OnChanges,o.AfterContentInit,o.AfterContentChecked,o.AfterViewInit,o.AfterViewChecked],n.define=i,r.exports}),System.register("angular2/src/core/linker/query_list",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/async"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/collection"),a=e("angular2/src/facade/lang"),s=e("angular2/src/facade/async"),c=function(){function e(){this._results=[],this._emitter=new s.EventEmitter}return Object.defineProperty(e.prototype,"changes",{get:function(){return this._emitter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._results.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"first",{get:function(){return o.ListWrapper.first(this._results)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return o.ListWrapper.last(this._results)},enumerable:!0,configurable:!0}),e.prototype.map=function(e){return this._results.map(e)},e.prototype.filter=function(e){return this._results.filter(e)},e.prototype.reduce=function(e,t){return this._results.reduce(e,t)},e.prototype.toArray=function(){return o.ListWrapper.clone(this._results)},e.prototype[a.getSymbolIterator()]=function(){return this._results[a.getSymbolIterator()]()},e.prototype.toString=function(){return this._results.toString()},e.prototype.reset=function(e){this._results=e},e.prototype.notifyOnChanges=function(){this._emitter.emit(this)},e}();return t.QueryList=c,n.define=i,r.exports}),System.register("angular2/src/core/linker/event_config",[],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0,t.EVENT_TARGET_SEPARATOR=":";var o=function(){function e(e,t,r){this.fieldName=e,this.eventName=t,this.isLongForm=r}return e.parse=function(r){var n=r,i=r,o=!1,a=r.indexOf(t.EVENT_TARGET_SEPARATOR);return a>-1&&(n=r.substring(0,a).trim(),i=r.substring(a+1).trim(),o=!0),new e(n,i,o)},e.prototype.getFullName=function(){return this.isLongForm?""+this.fieldName+t.EVENT_TARGET_SEPARATOR+this.eventName:this.eventName},e}();return t.EventConfig=o,n.define=i,r.exports}),System.register("angular2/src/core/linker/directive_resolver",["angular2/src/core/di","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/src/core/metadata","angular2/src/core/reflection/reflection"],!0,function(e,t,r){function n(e){return e instanceof d.DirectiveMetadata}var i=System.global,o=i.define;i.define=void 0;var a=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);rLine truncated
|
||||
function t(){e.apply(this,arguments)}return o(t,e),t.prototype.supports=function(e){return!0},t.prototype.addEventListener=function(e,t,r){var n=this.manager.getZone(),i=function(e){return n.run(function(){return r(e)})};this.manager.getZone().runOutsideAngular(function(){c.DOM.on(e,t,i)})},t.prototype.addGlobalEventListener=function(e,t,r){var n=c.DOM.getGlobalEventTarget(e),i=this.manager.getZone(),o=function(e){return i.run(function(){return r(e)})};return this.manager.getZone().runOutsideAngular(function(){return c.DOM.onAndCancel(n,t,o)})},t=a([l.Injectable(),s("design:paramtypes",[])],t)}(u.EventManagerPlugin);return t.DomEventsPlugin=p,n.define=i,r.exports}),System.register("angular2/src/platform/dom/debug/by",["angular2/src/facade/lang","angular2/src/platform/dom/dom_adapter"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/lang"),a=e("angular2/src/platform/dom/dom_adapter"),s=function(){function e(){}return e.all=function(){return function(e){return!0}},e.css=function(e){return function(t){return o.isPresent(t.nativeElement)?a.DOM.elementMatches(t.nativeElement,e):!1}},e.directive=function(e){return function(t){return t.hasDirective(e)}},e}();return t.By=s,n.define=i,r.exports}),System.register("angular2/src/platform/dom/debug/debug_element_view_listener",["angular2/src/facade/lang","angular2/src/facade/collection","angular2/src/core/di","angular2/src/core/linker/view_listener","angular2/src/platform/dom/dom_adapter","angular2/src/core/render/api","angular2/src/core/debug/debug_element"],!0,function(e,t,r){function n(e,t){u.isPresent(e)&&h.DOM.isElementNode(e)&&h.DOM.setData(e,v,t.join(_))}function i(e){var t=h.DOM.getData(e,v);return u.isPresent(t)?t.split(_).map(function(e){return u.NumberWrapper.parseInt(e,10)}):null}function o(e){var t=i(e);if(u.isPresent(t)){var r=C.get(t[0]);if(u.isPresent(r))return new m.DebugElement_(r,t[1])}return null}var a=System.global,s=a.define;a.define=void 0;var c=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},u=e("angular2/src/facade/lang"),p=e("angular2/src/facade/collection"),d=e("angular2/src/core/di"),f=e("angular2/src/core/linker/view_listener"),h=e("angular2/src/platform/dom/dom_adapter"),g=e("angular2/src/core/render/api"),m=e("angular2/src/core/debug/debug_element"),v="ngid",y="ng.probe",_="#",b=new p.Map,C=new p.Map,w=0;t.inspectNativeElement=o;var P=function(){function e(e){this._renderer=e,h.DOM.setGlobalVar(y,o)}return e.prototype.onViewCreated=function(e){var t=w++;C.set(t,e),b.set(e,t);for(var r=0;r<e.elementRefs.length;r++){var i=e.elementRefs[r];n(this._renderer.getNativeElementSync(i),[t,r])}},e.prototype.onViewDestroyed=function(e){var t=b.get(e);b["delete"](e),C["delete"](t)},e=c([d.Injectable(),l("design:paramtypes",[g.Renderer])],e)}();return t.DebugElementViewListener=P,t.ELEMENT_PROBE_PROVIDERS=u.CONST_EXPR([P,u.CONST_EXPR(new d.Provider(f.AppViewListener,{useExisting:P}))]),t.ELEMENT_PROBE_BINDINGS=t.ELEMENT_PROBE_PROVIDERS,a.define=s,r.exports}),System.register("angular2/src/platform/dom/dom_adapter",["angular2/src/facade/lang"],!0,function(e,t,r){function n(e){a.isBlank(t.DOM)&&(t.DOM=e)}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/facade/lang");t.DOM=null,t.setRootDomAdapter=n;var s=function(){function e(){}return e}();return t.DomAdapter=s,i.define=o,r.exports}),System.register("angular2/src/core/di/decorators",["angular2/src/core/di/metadata","angular2/src/core/util/decorators"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/di/metadata"),a=e("angular2/src/core/util/decorators");return t.Inject=a.makeParamDecorator(o.InjectMetadata),t.Optional=a.makeParamDecorator(o.OptionalMetadata),t.Injectable=a.makeDecorator(o.InjectableMetadata),t.Self=a.makeParamDecorator(o.SelfMetadata),t.Host=a.makeParamDecorator(o.HostMetadata),t.SkipSelf=a.makeParamDecorator(o.SkipSelfMetadata),n.define=i,r.exports}),System.register("angular2/src/facade/exceptions",["angular2/src/facade/exception_handler","angular2/src/facade/exception_handler"],!0,function(e,t,r){function n(e){return new TypeError(e)}function i(){throw new u("unimplemented")}var o=System.global,a=o.define;o.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=e("angular2/src/facade/exception_handler"),l=e("angular2/src/facade/exception_handler");t.ExceptionHandler=l.ExceptionHandler;var u=functiLine truncated
|
||||
var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/lang"),a=e("angular2/src/facade/exceptions"),s=e("angular2/src/facade/collection"),c=e("angular2/src/core/change_detection/pipes"),l=function(){function e(e){this.config=e,this.config=e}return e.fromProviders=function(t){var r={};return t.forEach(function(e){return r[e.name]=e}),new e(r)},e.prototype.get=function(e){var t=this.config[e];if(o.isBlank(t))throw new a.BaseException("Cannot find pipe '"+e+"'.");return t},e}();t.ProtoPipes=l;var u=function(){function e(e,t){this.proto=e,this.injector=t,this._config={}}return e.prototype.get=function(e){var t=s.StringMapWrapper.get(this._config,e);if(o.isPresent(t))return t;var r=this.proto.get(e),n=this.injector.instantiateResolved(r),i=new c.SelectedPipe(n,r.pure);return r.pure&&s.StringMapWrapper.set(this._config,e,i),i},e}();return t.Pipes=u,n.define=i,r.exports}),System.register("angular2/src/core/linker/view",["angular2/src/facade/collection","angular2/src/core/change_detection/change_detection","angular2/src/core/change_detection/interfaces","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/core/linker/view_ref","angular2/src/core/render/util","angular2/src/core/linker/view_ref","angular2/src/core/change_detection/interfaces"],!0,function(e,t,r){function n(e){for(var t={},r=e;u.isPresent(r);)t=s.StringMapWrapper.merge(t,s.MapWrapper.toStringMap(r.current)),r=r.parent;return t}var i=System.global,o=i.define;i.define=void 0;var a=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},s=e("angular2/src/facade/collection"),c=e("angular2/src/core/change_detection/change_detection"),l=e("angular2/src/core/change_detection/interfaces"),u=e("angular2/src/facade/lang"),p=e("angular2/src/facade/exceptions"),d=e("angular2/src/core/linker/view_ref"),f=e("angular2/src/core/render/util"),h=e("angular2/src/core/linker/view_ref"),g=e("angular2/src/core/change_detection/interfaces");t.DebugContext=g.DebugContext;var m="ng-reflect-";!function(e){e[e.HOST=0]="HOST",e[e.COMPONENT=1]="COMPONENT",e[e.EMBEDDED=2]="EMBEDDED"}(t.ViewType||(t.ViewType={}));var v=(t.ViewType,function(){function e(){this.views=[]}return e}());t.AppViewContainer=v;var y=function(){function e(e,t,r,n,i,o,a,l,u){this.renderer=e,this.proto=t,this.viewOffset=r,this.elementOffset=n,this.textOffset=i,this.render=a,this.renderFragment=l,this.containerElementInjector=u,this.views=null,this.elementInjectors=null,this.viewContainers=null,this.preBuiltObjects=null,this.changeDetector=null,this.context=null,this.ref=new h.ViewRef_(this),this.locals=new c.Locals(null,s.MapWrapper.clone(o))}return e.prototype.init=function(e,t,r,n,i,o,a){this.changeDetector=e,this.elementInjectors=t,this.rootElementInjectors=r,this.preBuiltObjects=n,this.views=i,this.elementRefs=o,this.viewContainers=a},e.prototype.setLocal=function(e,t){if(!this.hydrated())throw new p.BaseException("Cannot set locals on dehydrated view.");if(this.proto.templateVariableBindings.has(e)){var r=this.proto.templateVariableBindings.get(e);this.locals.set(r,t)}},e.prototype.hydrated=function(){return u.isPresent(this.context)},e.prototype.triggerEventHandlers=function(e,t,r){var n=new s.Map;n.set("$event",t),this.dispatchEvent(r,e,n)},e.prototype.notifyOnBinding=function(e,t){if(e.isTextNode())this.renderer.setText(this.render,e.elementIndex+this.textOffset,t);else{var r=this.elementRefs[this.elementOffset+e.elementIndex];if(e.isElementProperty())this.renderer.setElementProperty(r,e.name,t);else if(e.isElementAttribute())this.renderer.setElementAttribute(r,e.name,u.isPresent(t)?""+t:null);else if(e.isElementClass())this.renderer.setElementClass(r,e.name,t);else{if(!e.isElementStyle())throw new p.BaseException("Unsupported directive record");var n=u.isPresent(e.unit)?e.unit:"";this.renderer.setElementStyle(r,e.name,u.isPresent(t)?""+t+n:null)}}},e.prototype.logBindingUpdate=function(e,t){if(e.isDirective()||e.isElementProperty()){var r=this.elementRefs[this.elementOffset+e.elementIndex];this.renderer.setBindingDebugInfo(r,""+m+f.camelCaseToDashCase(e.name),""+t)}},e.prototype.notifyAfterContentChecked=function(){for(var e=this.proto.elementBinders.length,t=this.elementInjectors,r=e-1;r>=0;r--)u.isPresent(t[r+this.elementOffset])&&t[r+this.elementOffset].ngAfterContentChecked()},e.prototype.notifyAfterViewChecked=function(){for(var e=this.proto.elementBinders.length,t=this.elementInjectors,r=e-1;r>=0;r--)u.isPresent(t[r+this.elementOffset])&&t[r+this.elementOffset].ngAfterViewChecked()},e.prototype.getDirectiveFor=function(e){var t=this.elementInjectors[this.elementOffset+e.elementIndex];return t.getDirectiveAtIndex(e.directiveIndex)},e.prototype.getNestedView=function(e){var t=this.elementInjectors[e];return u.isPresent(t)?t.getNestedView():null},e.prototype.getContainerElement=function(){return u.isPresent(this.containerElemenLine truncated
|
||||
a.isPresent(l)&&(this._updateDirectiveOrElement(l,s),n=!0,r=this._addChange(s,l,r))}o.lastInDirective&&(r=null,n&&!s.isDefaultChangeDetection()&&this._getDetectorFor(c.directiveIndex).markAsCheckOnce(),n=!1)}},t.prototype._firstInBinding=function(e){var t=u.ChangeDetectionUtil.protoByIndex(this._records,e.selfIndex-1);return a.isBlank(t)||t.bindingRecord!==e.bindingRecord},t.prototype.afterContentLifecycleCallbacksInternal=function(){for(var e=this._directiveRecords,t=e.length-1;t>=0;--t){var r=e[t];r.callAfterContentInit&&this.state==p.ChangeDetectorState.NeverChecked&&this._getDirectiveFor(r.directiveIndex).ngAfterContentInit(),r.callAfterContentChecked&&this._getDirectiveFor(r.directiveIndex).ngAfterContentChecked()}},t.prototype.afterViewLifecycleCallbacksInternal=function(){for(var e=this._directiveRecords,t=e.length-1;t>=0;--t){var r=e[t];r.callAfterViewInit&&this.state==p.ChangeDetectorState.NeverChecked&&this._getDirectiveFor(r.directiveIndex).ngAfterViewInit(),r.callAfterViewChecked&&this._getDirectiveFor(r.directiveIndex).ngAfterViewChecked()}},t.prototype._updateDirectiveOrElement=function(t,r){if(a.isBlank(r.directiveRecord))e.prototype.notifyDispatcher.call(this,t.currentValue);else{var n=r.directiveRecord.directiveIndex;r.setter(this._getDirectiveFor(n),t.currentValue)}this._genConfig.logBindingUpdate&&e.prototype.logBindingUpdate.call(this,t.currentValue)},t.prototype._addChange=function(t,r,n){return t.callOnChanges()?e.prototype.addChange.call(this,n,r.previousValue,r.currentValue):n},t.prototype._getDirectiveFor=function(e){return this.directives.getDirectiveFor(e)},t.prototype._getDetectorFor=function(e){return this.directives.getDetectorFor(e)},t.prototype._check=function(e,t,r,n){return e.isPipeRecord()?this._pipeCheck(e,t,r):this._referenceCheck(e,t,r,n)},t.prototype._referenceCheck=function(t,r,n,i){if(this._pureFuncAndArgsDidNotChange(t))return this._setChanged(t,!1),null;var o=this._calculateCurrValue(t,n,i);if(this.strategy===p.ChangeDetectionStrategy.OnPushObserve&&e.prototype.observeValue.call(this,o,t.selfIndex),t.shouldBeChecked()){var a=this._readSelf(t,n);if(u.ChangeDetectionUtil.looseNotIdentical(a,o)){if(t.lastInBinding){var s=u.ChangeDetectionUtil.simpleChange(a,o);return r&&this.throwOnChangeError(a,o),this._writeSelf(t,o,n),this._setChanged(t,!0),s}return this._writeSelf(t,o,n),this._setChanged(t,!0),null}return this._setChanged(t,!1),null}return this._writeSelf(t,o,n),this._setChanged(t,!0),null},t.prototype._calculateCurrValue=function(e,t,r){switch(e.mode){case d.RecordType.Self:return this._readContext(e,t);case d.RecordType.Const:return e.funcOrValue;case d.RecordType.PropertyRead:var n=this._readContext(e,t);return e.funcOrValue(n);case d.RecordType.SafeProperty:var n=this._readContext(e,t);return a.isBlank(n)?null:e.funcOrValue(n);case d.RecordType.PropertyWrite:var n=this._readContext(e,t),i=this._readArgs(e,t)[0];return e.funcOrValue(n,i),i;case d.RecordType.KeyedWrite:var n=this._readContext(e,t),o=this._readArgs(e,t)[0],i=this._readArgs(e,t)[1];return n[o]=i,i;case d.RecordType.Local:return r.get(e.name);case d.RecordType.InvokeMethod:var n=this._readContext(e,t),c=this._readArgs(e,t);return e.funcOrValue(n,c);case d.RecordType.SafeMethodInvoke:var n=this._readContext(e,t);if(a.isBlank(n))return null;var c=this._readArgs(e,t);return e.funcOrValue(n,c);case d.RecordType.KeyedRead:var l=this._readArgs(e,t)[0];return this._readContext(e,t)[l];case d.RecordType.Chain:var c=this._readArgs(e,t);return c[c.length-1];case d.RecordType.InvokeClosure:return a.FunctionWrapper.apply(this._readContext(e,t),this._readArgs(e,t));case d.RecordType.Interpolate:case d.RecordType.PrimitiveOp:case d.RecordType.CollectionLiteral:return a.FunctionWrapper.apply(e.funcOrValue,this._readArgs(e,t));default:throw new s.BaseException("Unknown operation "+e.mode)}},t.prototype._pipeCheck=function(e,t,r){var n=this._readContext(e,r),i=this._pipeFor(e,n);if(!i.pure||this._argsOrContextChanged(e)){var o=this._readArgs(e,r),a=i.pipe.transform(n,o);if(e.shouldBeChecked()){var s=this._readSelf(e,r);if(u.ChangeDetectionUtil.looseNotIdentical(s,a)){if(a=u.ChangeDetectionUtil.unwrapValue(a),e.lastInBinding){var c=u.ChangeDetectionUtil.simpleChange(s,a);return t&&this.throwOnChangeError(s,a),this._writeSelf(e,a,r),this._setChanged(e,!0),c}return this._writeSelf(e,a,r),this._setChanged(e,!0),null}return this._setChanged(e,!1),null}return this._writeSelf(e,a,r),this._setChanged(e,!0),null}},t.prototype._pipeFor=function(e,t){var r=this._readPipe(e);if(a.isPresent(r))return r;var n=this.pipes.get(e.name);return this._writePipe(e,n),n},t.prototype._readContext=function(e,t){return-1==e.contextIndex?this._getDirectiveFor(e.directiveIndex):t[e.contextIndex]},t.prototype._readSelf=function(e,t){return t[e.selfIndex]},t.prototype._writeSelf=function(e,t,r){r[e.selfIndex]=t},t.prototype._readPipe=function(e){return this.localPipes[e.selfIndex]},t.prototype._writePipe=function(e,t){this.localPipes[e.selfIndLine truncated
|
||||
if(6==e)return this.obj6;if(7==e)return this.obj7;if(8==e)return this.obj8;if(9==e)return this.obj9;throw new l.OutOfBoundsError(e)},e.prototype.getMaxNumberOfObjects=function(){return f},e}();t.InjectorInlineStrategy=y;var _=function(){function e(e,r){this.protoStrategy=e,this.injector=r,this.objs=s.ListWrapper.createFixedSize(e.providers.length),s.ListWrapper.fill(this.objs,t.UNDEFINED)}return e.prototype.resetConstructionCounter=function(){this.injector._constructionCounter=0},e.prototype.instantiateProvider=function(e,t){return this.injector._new(e,t)},e.prototype.attach=function(e,t){var r=this.injector;r._parent=e,r._isHost=t},e.prototype.getObjByKeyId=function(e,r){for(var i=this.protoStrategy,o=0;o<i.keyIds.length;o++)if(i.keyIds[o]===e&&n(i.visibilities[o],r))return this.objs[o]===t.UNDEFINED&&(this.objs[o]=this.injector._new(i.providers[o],i.visibilities[o])),this.objs[o];return t.UNDEFINED},e.prototype.getObjAtIndex=function(e){if(0>e||e>=this.objs.length)throw new l.OutOfBoundsError(e);return this.objs[e]},e.prototype.getMaxNumberOfObjects=function(){return this.objs.length},e}();t.InjectorDynamicStrategy=_;var b=function(){function e(e,t){this.provider=e,this.visibility=t}return e.prototype.getKeyId=function(){return this.provider.key.id},e}();t.ProviderWithVisibility=b;var C=function(){function e(e,t,r,n){void 0===t&&(t=null),void 0===r&&(r=null),void 0===n&&(n=null),this._depProvider=r,this._debugContext=n,this._isHost=!1,this._constructionCounter=0,this._proto=e,this._parent=t,this._strategy=e._strategy.createInjectorStrategy(this)}return e.resolve=function(e){return c.resolveProviders(e)},e.resolveAndCreate=function(t){var r=e.resolve(t);return e.fromResolvedProviders(r)},e.fromResolvedProviders=function(t){var r=t.map(function(e){return new b(e,h.Public)}),n=new v(r);return new e(n,null,null)},e.fromResolvedBindings=function(t){return e.fromResolvedProviders(t)},e.prototype.debugContext=function(){return this._debugContext()},e.prototype.get=function(e){return this._getByKey(p.Key.get(e),null,null,!1,h.PublicAndPrivate)},e.prototype.getOptional=function(e){return this._getByKey(p.Key.get(e),null,null,!0,h.PublicAndPrivate)},e.prototype.getAt=function(e){return this._strategy.getObjAtIndex(e)},Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"internalStrategy",{get:function(){return this._strategy},enumerable:!0,configurable:!0}),e.prototype.resolveAndCreateChild=function(t){var r=e.resolve(t);return this.createChildFromResolved(r)},e.prototype.createChildFromResolved=function(t){var r=t.map(function(e){return new b(e,h.Public)}),n=new v(r),i=new e(n,null,null);return i._parent=this,i},e.prototype.resolveAndInstantiate=function(t){return this.instantiateResolved(e.resolve([t])[0])},e.prototype.instantiateResolved=function(e){return this._instantiateProvider(e,h.PublicAndPrivate)},e.prototype._new=function(e,t){if(this._constructionCounter++>this._strategy.getMaxNumberOfObjects())throw new l.CyclicDependencyError(this,e.key);return this._instantiateProvider(e,t)},e.prototype._instantiateProvider=function(e,t){if(e.multiProvider){for(var r=s.ListWrapper.createFixedSize(e.resolvedFactories.length),n=0;n<e.resolvedFactories.length;++n)r[n]=this._instantiate(e,e.resolvedFactories[n],t);return r}return this._instantiate(e,e.resolvedFactories[0],t)},e.prototype._instantiate=function(e,t,r){var n,i,o,a,s,c,u,p,d,f,h,g,m,v,y,_,b,C,w,P,E=t.factory,S=t.dependencies,R=S.length;try{n=R>0?this._getByDependency(e,S[0],r):null,i=R>1?this._getByDependency(e,S[1],r):null,o=R>2?this._getByDependency(e,S[2],r):null,a=R>3?this._getByDependency(e,S[3],r):null,s=R>4?this._getByDependency(e,S[4],r):null,c=R>5?this._getByDependency(e,S[5],r):null,u=R>6?this._getByDependency(e,S[6],r):null,p=R>7?this._getByDependency(e,S[7],r):null,d=R>8?this._getByDependency(e,S[8],r):null,f=R>9?this._getByDependency(e,S[9],r):null,h=R>10?this._getByDependency(e,S[10],r):null,g=R>11?this._getByDependency(e,S[11],r):null,m=R>12?this._getByDependency(e,S[12],r):null,v=R>13?this._getByDependency(e,S[13],r):null,y=R>14?this._getByDependency(e,S[14],r):null,_=R>15?this._getByDependency(e,S[15],r):null,b=R>16?this._getByDependency(e,S[16],r):null,C=R>17?this._getByDependency(e,S[17],r):null,w=R>18?this._getByDependency(e,S[18],r):null,P=R>19?this._getByDependency(e,S[19],r):null}catch(x){throw(x instanceof l.AbstractProviderError||x instanceof l.InstantiationError)&&x.addKey(this,e.key),x}var O;try{switch(R){case 0:O=E();break;case 1:O=E(n);break;case 2:O=E(n,i);break;case 3:O=E(n,i,o);break;case 4:O=E(n,i,o,a);break;case 5:O=E(n,i,o,a,s);break;case 6:O=E(n,i,o,a,s,c);break;case 7:O=E(n,i,o,a,s,c,u);break;case 8:O=E(n,i,o,a,s,c,u,p);break;case 9:O=E(n,i,o,a,s,c,u,p,d);break;case 10:O=E(n,i,o,a,s,c,u,p,d,f);break;case 11:O=E(n,i,o,a,s,c,u,p,d,f,h);break;case 12:O=E(n,i,o,a,s,c,u,p,d,f,h,g);break;case 13:O=E(n,i,o,a,s,c,u,p,d,f,h,g,m);break;caLine truncated
|
||||
if(i.key.id===T.instance().viewContainerId)return this.getViewContainerRef();if(i.key.id===T.instance().templateRefId){if(l.isBlank(this._preBuiltObjects.templateRef)){if(i.optional)return null;throw new f.NoProviderError(null,i.key)}return this._preBuiltObjects.templateRef}}else if(t instanceof x.PipeProvider&&r.key.id===T.instance().changeDetectorRefId){var s=this._preBuiltObjects.view.getNestedView(this._preBuiltObjects.elementRef.boundElementIndex);return s.changeDetector.ref}return h.UNDEFINED},t.prototype._buildAttribute=function(e){var t=this._proto.attributes;return l.isPresent(t)&&t.has(e.attributeName)?t.get(e.attributeName):null},t.prototype.addDirectivesMatchingQuery=function(e,t){var r=l.isBlank(this._preBuiltObjects)?null:this._preBuiltObjects.templateRef;e.selector===b.TemplateRef&&l.isPresent(r)&&t.push(r),this._strategy.addDirectivesMatchingQuery(e,t)},t.prototype._buildQueryStrategy=function(){return 0===this._proto.protoQueryRefs.length?W:this._proto.protoQueryRefs.length<=U.NUMBER_OF_SUPPORTED_QUERIES?new U(this):new H(this)},t.prototype.link=function(e){e.addChild(this)},t.prototype.unlink=function(){this.remove()},t.prototype.getDirectiveAtIndex=function(e){return this._injector.getAt(e)},t.prototype.hasInstances=function(){return this._proto.hasBindings&&this.hydrated},t.prototype.getHost=function(){return this._host},t.prototype.getBoundElementIndex=function(){return this._proto.index},t.prototype.getRootViewInjectors=function(){if(!this.hydrated)return[];var e=this._preBuiltObjects.view,t=e.getNestedView(e.elementOffset+this.getBoundElementIndex());return l.isPresent(t)?t.rootElementInjectors:[]},t.prototype.ngAfterViewChecked=function(){this._queryStrategy.updateViewQueries()},t.prototype.ngAfterContentChecked=function(){this._queryStrategy.updateContentQueries()},t.prototype.traverseAndSetQueriesAsDirty=function(){for(var e=this;l.isPresent(e);)e._setQueriesAsDirty(),e=e.parent},t.prototype._setQueriesAsDirty=function(){this._queryStrategy.setContentQueriesAsDirty(),l.isPresent(this._host)&&this._host._queryStrategy.setViewQueriesAsDirty()},t}(A);t.ElementInjector=L;var F=function(){function e(){}return e.prototype.setContentQueriesAsDirty=function(){},e.prototype.setViewQueriesAsDirty=function(){},e.prototype.hydrate=function(){},e.prototype.dehydrate=function(){},e.prototype.updateContentQueries=function(){},e.prototype.updateViewQueries=function(){},e.prototype.findQuery=function(e){throw new u.BaseException("Cannot find query for directive "+e+".")},e}(),W=new F,U=function(){function e(e){var t=e._proto.protoQueryRefs;t.length>0&&(this.query0=new z(t[0],e)),t.length>1&&(this.query1=new z(t[1],e)),t.length>2&&(this.query2=new z(t[2],e))}return e.prototype.setContentQueriesAsDirty=function(){l.isPresent(this.query0)&&!this.query0.isViewQuery&&(this.query0.dirty=!0),l.isPresent(this.query1)&&!this.query1.isViewQuery&&(this.query1.dirty=!0),l.isPresent(this.query2)&&!this.query2.isViewQuery&&(this.query2.dirty=!0)},e.prototype.setViewQueriesAsDirty=function(){l.isPresent(this.query0)&&this.query0.isViewQuery&&(this.query0.dirty=!0),l.isPresent(this.query1)&&this.query1.isViewQuery&&(this.query1.dirty=!0),l.isPresent(this.query2)&&this.query2.isViewQuery&&(this.query2.dirty=!0)},e.prototype.hydrate=function(){l.isPresent(this.query0)&&this.query0.hydrate(),l.isPresent(this.query1)&&this.query1.hydrate(),l.isPresent(this.query2)&&this.query2.hydrate()},e.prototype.dehydrate=function(){l.isPresent(this.query0)&&this.query0.dehydrate(),l.isPresent(this.query1)&&this.query1.dehydrate(),l.isPresent(this.query2)&&this.query2.dehydrate()},e.prototype.updateContentQueries=function(){l.isPresent(this.query0)&&!this.query0.isViewQuery&&this.query0.update(),l.isPresent(this.query1)&&!this.query1.isViewQuery&&this.query1.update(),l.isPresent(this.query2)&&!this.query2.isViewQuery&&this.query2.update()},e.prototype.updateViewQueries=function(){l.isPresent(this.query0)&&this.query0.isViewQuery&&this.query0.update(),l.isPresent(this.query1)&&this.query1.isViewQuery&&this.query1.update(),l.isPresent(this.query2)&&this.query2.isViewQuery&&this.query2.update()},e.prototype.findQuery=function(e){if(l.isPresent(this.query0)&&this.query0.protoQueryRef.query===e)return this.query0;if(l.isPresent(this.query1)&&this.query1.protoQueryRef.query===e)return this.query1;if(l.isPresent(this.query2)&&this.query2.protoQueryRef.query===e)return this.query2;throw new u.BaseException("Cannot find query for directive "+e+".")},e.NUMBER_OF_SUPPORTED_QUERIES=3,e}(),H=function(){function e(e){this.queries=e._proto.protoQueryRefs.map(function(t){return new z(t,e)})}return e.prototype.setContentQueriesAsDirty=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.isViewQuery||(t.dirty=!0)}},e.prototype.setViewQueriesAsDirty=function(){for(var e=0;e<this.queries.length;++e){var t=this.queries[e];t.isViewQuery&&(t.dirty=!0)}},e.prototype.hydrate=function(){for(var e=0;e<this.queries.length;++e){var t=thiLine truncated
|
||||
},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return this.inputs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"outputs",{get:function(){return c.isPresent(this._events)&&this._events.length>0?this._events:this._outputs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){return this.outputs},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providers",{get:function(){return c.isPresent(this._bindings)&&this._bindings.length>0?this._bindings:this._providers},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bindings",{get:function(){return this.providers},enumerable:!0,configurable:!0}),t=a([c.CONST(),s("design:paramtypes",[Object])],t)}(l.InjectableMetadata);t.DirectiveMetadata=p;var d=function(e){function t(t){var r=void 0===t?{}:t,n=r.selector,i=r.inputs,o=r.outputs,a=r.properties,s=r.events,c=r.host,l=r.exportAs,p=r.moduleId,d=r.bindings,f=r.providers,h=r.viewBindings,g=r.viewProviders,m=r.changeDetection,v=void 0===m?u.ChangeDetectionStrategy.Default:m,y=r.queries,_=r.templateUrl,b=r.template,C=r.styleUrls,w=r.styles,P=r.directives,E=r.pipes,S=r.encapsulation;e.call(this,{selector:n,inputs:i,outputs:o,properties:a,events:s,host:c,exportAs:l,bindings:d,providers:f,queries:y}),this.changeDetection=v,this._viewProviders=g,this._viewBindings=h,this.templateUrl=_,this.template=b,this.styleUrls=C,this.styles=w,this.directives=P,this.pipes=E,this.encapsulation=S,this.moduleId=p}return o(t,e),Object.defineProperty(t.prototype,"viewProviders",{get:function(){return c.isPresent(this._viewBindings)&&this._viewBindings.length>0?this._viewBindings:this._viewProviders},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"viewBindings",{get:function(){return this.viewProviders},enumerable:!0,configurable:!0}),t=a([c.CONST(),s("design:paramtypes",[Object])],t)}(p);t.ComponentMetadata=d;var f=function(e){function t(t){var r=t.name,n=t.pure;e.call(this),this.name=r,this._pure=n}return o(t,e),Object.defineProperty(t.prototype,"pure",{get:function(){return c.isPresent(this._pure)?this._pure:!0},enumerable:!0,configurable:!0}),t=a([c.CONST(),s("design:paramtypes",[Object])],t)}(l.InjectableMetadata);t.PipeMetadata=f;var h=function(){function e(e){this.bindingPropertyName=e}return e=a([c.CONST(),s("design:paramtypes",[String])],e)}();t.InputMetadata=h;var g=function(){function e(e){this.bindingPropertyName=e}return e=a([c.CONST(),s("design:paramtypes",[String])],e)}();t.OutputMetadata=g;var m=function(){function e(e){this.hostPropertyName=e}return e=a([c.CONST(),s("design:paramtypes",[String])],e)}();t.HostBindingMetadata=m;var v=function(){function e(e,t){this.eventName=e,this.args=t}return e=a([c.CONST(),s("design:paramtypes",[String,Array])],e)}();return t.HostListenerMetadata=v,n.define=i,r.exports}),System.register("angular2/src/facade/async",["angular2/src/facade/lang","angular2/src/facade/promise","rxjs/Subject","rxjs/observable/fromPromise","rxjs/operator/toPromise","rxjs/Observable","rxjs/Subject"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/facade/lang"),s=e("angular2/src/facade/promise");t.PromiseWrapper=s.PromiseWrapper,t.Promise=s.Promise;var c=e("rxjs/Subject"),l=e("rxjs/observable/fromPromise"),u=e("rxjs/operator/toPromise"),p=e("rxjs/Observable");t.Observable=p.Observable;var d=e("rxjs/Subject");t.Subject=d.Subject;var f=function(){function e(){}return e.setTimeout=function(e,t){return a.global.setTimeout(e,t)},e.clearTimeout=function(e){a.global.clearTimeout(e)},e.setInterval=function(e,t){return a.global.setInterval(e,t)},e.clearInterval=function(e){a.global.clearInterval(e)},e}();t.TimerWrapper=f;var h=function(){function e(){}return e.subscribe=function(e,t,r,n){return void 0===n&&(n=function(){}),r="function"==typeof r&&r||a.noop,n="function"==typeof n&&n||a.noop,e.subscribe({next:t,error:r,complete:n})},e.isObservable=function(e){return!!e.subscribe},e.hasSubscribers=function(e){return e.observers.length>0},e.dispose=function(e){e.unsubscribe()},e.callNext=function(e,t){e.next(t)},e.callEmit=function(e,t){e.emit(t)},e.callError=function(e,t){e.error(t)},e.callComplete=function(e){e.complete()},e.fromPromise=function(e){return l.PromiseObservable.create(e)},e.toPromise=function(e){return u.toPromise.call(e)},e}();t.ObservableWrapper=h;var g=function(e){function t(t){void 0===t&&(t=!0),e.call(this),this._isAsync=t}return o(t,e),t.prototype.emit=function(t){e.prototype.next.call(this,t)},t.prototype.next=function(t){e.prototype.next.call(this,t)},t.prototype.subscribe=function(t,r,n){var i,o=function(e){return null},a=function(){return null};return t&&"object"==typeof t?(i=this._isAsync?function(e){setTimeout(function()Line truncated
|
||||
if(void 0===r&&(r=null),s.isBlank(t))return t;if(!s.isString(t))throw new l.InvalidPipeArgumentException(e,t);return t.toUpperCase()},e=o([s.CONST(),c.Pipe({name:"uppercase"}),c.Injectable(),a("design:paramtypes",[])],e)}();return t.UpperCasePipe=u,n.define=i,r.exports}),System.register("angular2/src/common/pipes/lowercase_pipe",["angular2/src/facade/lang","angular2/core","angular2/src/common/pipes/invalid_pipe_argument_exception"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/facade/lang"),c=e("angular2/core"),l=e("angular2/src/common/pipes/invalid_pipe_argument_exception"),u=function(){function e(){}return e.prototype.transform=function(t,r){if(void 0===r&&(r=null),s.isBlank(t))return t;if(!s.isString(t))throw new l.InvalidPipeArgumentException(e,t);return t.toLowerCase()},e=o([s.CONST(),c.Pipe({name:"lowercase"}),c.Injectable(),a("design:paramtypes",[])],e)}();return t.LowerCasePipe=u,n.define=i,r.exports}),System.register("angular2/src/common/pipes/json_pipe",["angular2/src/facade/lang","angular2/core"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/facade/lang"),c=e("angular2/core"),l=function(){function e(){}return e.prototype.transform=function(e,t){return void 0===t&&(t=null),s.Json.stringify(e)},e=o([s.CONST(),c.Pipe({name:"json",pure:!1}),c.Injectable(),a("design:paramtypes",[])],e)}();return t.JsonPipe=l,n.define=i,r.exports}),System.register("angular2/src/common/pipes/slice_pipe",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection","angular2/core","angular2/src/common/pipes/invalid_pipe_argument_exception"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/src/facade/lang"),c=e("angular2/src/facade/exceptions"),l=e("angular2/src/facade/collection"),u=e("angular2/core"),p=e("angular2/src/common/pipes/invalid_pipe_argument_exception"),d=function(){function e(){}return e.prototype.transform=function(t,r){if(void 0===r&&(r=null),s.isBlank(r)||0==r.length)throw new c.BaseException("Slice pipe requires one argument");if(!this.supports(t))throw new p.InvalidPipeArgumentException(e,t);if(s.isBlank(t))return t;var n=r[0],i=r.length>1?r[1]:null;return s.isString(t)?s.StringWrapper.slice(t,n,i):l.ListWrapper.slice(t,n,i)},e.prototype.supports=function(e){return s.isString(e)||s.isArray(e)},e=o([u.Pipe({name:"slice",pure:!1}),u.Injectable(),a("design:paramtypes",[])],e)}();return t.SlicePipe=d,n.define=i,r.exports}),System.register("angular2/src/facade/intl",[],!0,function(e,t,r){function n(e){return 2==e?"2-digit":"numeric"}function i(e){return 4>e?"short":"long"}function o(e){for(var t,r={},o=0;o<e.length;){for(t=o;t<e.length&&e[t]==e[o];)t++;var a=t-o;switch(e[o]){case"G":r.era=i(a);break;case"y":r.year=n(a);break;case"M":a>=3?r.month=i(a):r.month=n(a);break;case"d":r.day=n(a);break;case"E":r.weekday=i(a);break;case"j":r.hour=n(a);break;case"h":r.hour=n(a),r.hour12=!0;break;case"H":r.hour=n(a),r.hour12=!1;break;case"m":r.minute=n(a);break;case"s":r.second=n(a);break;case"z":r.timeZoneName="long";break;case"Z":r.timeZoneName="short"}o=t}return r}var a=System.global,s=a.define;a.define=void 0,function(e){e[e.Decimal=0]="Decimal",e[e.Percent=1]="Percent",e[e.Currency=2]="Currency"}(t.NumberFormatStyle||(t.NumberFormatStyle={}));var c=t.NumberFormatStyle,l=function(){function e(){}return e.format=function(e,t,r,n){var i=void 0===n?{}:n,o=i.minimumIntegerDigits,a=void 0===o?1:o,s=i.minimumFractionDigits,l=void 0===s?0:s,u=iLine truncated
|
||||
get:function(){return null},enumerable:!0,configurable:!0}),e}();return t.AbstractControlDirective=s,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/control_container",["angular2/src/common/forms/directives/abstract_control_directive"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/common/forms/directives/abstract_control_directive"),s=function(e){function t(){e.apply(this,arguments)}return o(t,e),Object.defineProperty(t.prototype,"formDirective",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),t}(a.AbstractControlDirective);return t.ControlContainer=s,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/ng_control",["angular2/src/common/forms/directives/abstract_control_directive","angular2/src/facade/exceptions"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=e("angular2/src/common/forms/directives/abstract_control_directive"),s=e("angular2/src/facade/exceptions"),c=function(e){function t(){e.apply(this,arguments),this.name=null,this.valueAccessor=null}return o(t,e),Object.defineProperty(t.prototype,"validator",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"asyncValidator",{get:function(){return s.unimplemented()},enumerable:!0,configurable:!0}),t}(a.AbstractControlDirective);return t.NgControl=c,n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/control_value_accessor",["angular2/core","angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/core"),a=e("angular2/src/facade/lang");return t.NG_VALUE_ACCESSOR=a.CONST_EXPR(new o.OpaqueToken("NgValueAccessor")),n.define=i,r.exports}),System.register("angular2/src/common/forms/validators",["angular2/src/facade/lang","angular2/src/facade/promise","angular2/src/facade/async","angular2/src/facade/collection","angular2/core"],!0,function(e,t,r){function n(e){return l.PromiseWrapper.isPromise(e)?e:u.ObservableWrapper.toPromise(e)}function i(e,t){return t.map(function(t){return t(e)})}function o(e){var t=e.reduce(function(e,t){return c.isPresent(t)?p.StringMapWrapper.merge(e,t):e},{});return p.StringMapWrapper.isEmpty(t)?null:t}var a=System.global,s=a.define;a.define=void 0;var c=e("angular2/src/facade/lang"),l=e("angular2/src/facade/promise"),u=e("angular2/src/facade/async"),p=e("angular2/src/facade/collection"),d=e("angular2/core");t.NG_VALIDATORS=c.CONST_EXPR(new d.OpaqueToken("NgValidators")),t.NG_ASYNC_VALIDATORS=c.CONST_EXPR(new d.OpaqueToken("NgAsyncValidators"));var f=function(){function e(){}return e.required=function(e){return c.isBlank(e.value)||""==e.value?{required:!0}:null},e.minLength=function(t){return function(r){if(c.isPresent(e.required(r)))return null;var n=r.value;return n.length<t?{minlength:{requiredLength:t,actualLength:n.length}}:null}},e.maxLength=function(t){return function(r){if(c.isPresent(e.required(r)))return null;var n=r.value;return n.length>t?{maxlength:{requiredLength:t,actualLength:n.length}}:null}},e.nullValidator=function(e){return null},e.compose=function(e){if(c.isBlank(e))return null;var t=e.filter(c.isPresent);return 0==t.length?null:function(e){return o(i(e,t))}},e.composeAsync=function(e){if(c.isBlank(e))return null;var t=e.filter(c.isPresent);return 0==t.length?null:function(e){var r=i(e,t).map(n);return l.PromiseWrapper.all(r).then(o)}},e}();return t.Validators=f,a.define=s,r.exports}),System.register("angular2/src/common/forms/directives/default_value_accessor",["angular2/core","angular2/src/common/forms/directives/control_value_accessor","angular2/src/facade/lang"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/core"),c=e("angular2/src/common/forms/directives/control_value_accessor"),l=e("angular2/src/facade/lang"),u=l.CONST_EXPR(new s.Provider(c.NG_VALUE_ACCESSOR,{useExisting:s.forwardRef(function(){return p}),multi:!0})),p=function(){function e(e,t){this._rendererLine truncated
|
||||
useExisting:c.forwardRef(function(){return g}),multi:!0})),g=function(){function e(e){this._validator=u.Validators.minLength(p.NumberWrapper.parseInt(e,10))}return e.prototype.validate=function(e){return this._validator(e)},e=o([c.Directive({selector:"[minlength][ngControl],[minlength][ngFormControl],[minlength][ngModel]",providers:[h]}),s(0,c.Attribute("minlength")),a("design:paramtypes",[String])],e)}();t.MinLengthValidator=g;var m=l.CONST_EXPR(new c.Provider(u.NG_VALIDATORS,{useExisting:c.forwardRef(function(){return v}),multi:!0})),v=function(){function e(e){this._validator=u.Validators.maxLength(p.NumberWrapper.parseInt(e,10))}return e.prototype.validate=function(e){return this._validator(e)},e=o([c.Directive({selector:"[maxlength][ngControl],[maxlength][ngFormControl],[maxlength][ngModel]",providers:[m]}),s(0,c.Attribute("maxlength")),a("design:paramtypes",[String])],e)}();return t.MaxLengthValidator=v,n.define=i,r.exports}),System.register("angular2/src/common/forms/form_builder",["angular2/core","angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/common/forms/model"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},s=e("angular2/core"),c=e("angular2/src/facade/collection"),l=e("angular2/src/facade/lang"),u=e("angular2/src/common/forms/model"),p=function(){function e(){}return e.prototype.group=function(e,t){void 0===t&&(t=null);var r=this._reduceControls(e),n=l.isPresent(t)?c.StringMapWrapper.get(t,"optionals"):null,i=l.isPresent(t)?c.StringMapWrapper.get(t,"validator"):null,o=l.isPresent(t)?c.StringMapWrapper.get(t,"asyncValidator"):null;return new u.ControlGroup(r,n,i,o)},e.prototype.control=function(e,t,r){return void 0===t&&(t=null),void 0===r&&(r=null),new u.Control(e,t,r)},e.prototype.array=function(e,t,r){var n=this;void 0===t&&(t=null),void 0===r&&(r=null);var i=e.map(function(e){return n._createControl(e)});return new u.ControlArray(i,t,r)},e.prototype._reduceControls=function(e){var t=this,r={};return c.StringMapWrapper.forEach(e,function(e,n){r[n]=t._createControl(e)}),r},e.prototype._createControl=function(e){if(e instanceof u.Control||e instanceof u.ControlGroup||e instanceof u.ControlArray)return e;if(l.isArray(e)){var t=e[0],r=e.length>1?e[1]:null,n=e.length>2?e[2]:null;return this.control(t,r,n)}return this.control(e)},e=o([s.Injectable(),a("design:paramtypes",[])],e)}();return t.FormBuilder=p,t.FORM_PROVIDERS=l.CONST_EXPR([p]),t.FORM_BINDINGS=t.FORM_PROVIDERS,n.define=i,r.exports}),System.register("angular2/src/common/common_directives",["angular2/src/facade/lang","angular2/src/common/forms","angular2/src/common/directives"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/facade/lang"),a=e("angular2/src/common/forms"),s=e("angular2/src/common/directives");return t.COMMON_DIRECTIVES=o.CONST_EXPR([s.CORE_DIRECTIVES,a.FORM_DIRECTIVES]),n.define=i,r.exports}),System.register("angular2/src/platform/dom/events/key_events",["angular2/src/platform/dom/dom_adapter","angular2/src/facade/lang","angular2/src/facade/collection","angular2/src/platform/dom/events/event_manager","angular2/src/core/di"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},c=e("angular2/src/platform/dom/dom_adapter"),l=e("angular2/src/facade/lang"),u=e("angular2/src/facade/collection"),p=e("angular2/src/platform/dom/events/event_manager"),d=e("angular2/src/core/di"),f=["alt","control","meta","shift"],h={alt:function(e){return e.altKey},control:function(e){return e.ctrlKey},meta:function(e){return e.metaKey},shift:function(e){return e.shiftKey}},g=function(e){function t(){e.call(this)}return o(t,e),t.prototype.supports=function(e){return l.isPresent(t.parseEventName(e))},t.prototype.addEventListener=function(e,r,n){var i=t.parseEventName(r),o=t.eventCallback(e,u.StringMapWrapper.gLine truncated
|
||||
return t}function a(e){var t=[];v.StringMapWrapper.forEach(e,function(e,r){t.push([r,e])}),v.ListWrapper.sort(t,function(e,t){return m.StringWrapper.compare(e[0],t[0])});var r=[];return t.forEach(function(e){r.push(e[0]),r.push(e[1])}),r}function s(e,t,r){return e==E||e==S?t+" "+r:r}function c(e){return e instanceof A?e.value:m.isString(e)?C.escapeSingleQuoteString(e):m.isBlank(e)?"null":""+e}function l(e){var t="["+e.map(c).join(",")+"]";return m.IS_DART?"const "+t:t}function u(e){var t=e.map(function(e){return""+b.moduleRef(e.type.moduleUrl)+e.type.name}),r="["+t.join(",")+"]";return m.IS_DART?"const "+r:r}function p(e){return m.IS_DART?""+t.TEMPLATE_COMMANDS_MODULE_REF+e:""+e}var d=System.global,f=d.define;d.define=void 0;var h=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},g=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},m=e("angular2/src/facade/lang"),v=e("angular2/src/facade/collection"),y=e("angular2/src/core/linker/template_commands"),_=e("angular2/src/compiler/template_ast"),b=e("angular2/src/compiler/source_module"),C=e("angular2/src/compiler/util"),w=e("angular2/src/core/di");t.TEMPLATE_COMMANDS_MODULE_REF=b.moduleRef("package:angular2/src/core/linker/template_commands"+C.MODULE_SUFFIX);var P="$implicit",E="class",S="style",R=function(){function e(){}return e.prototype.compileComponentRuntime=function(e,t,r,n){var i=new D(new x(e,n,r),0);return _.templateVisitAll(i,t),i.result},e.prototype.compileComponentCodeGen=function(e,t,r,n){var i=new D(new O(e,n,r),0);return _.templateVisitAll(i,t),new b.SourceExpression([],l(i.result))},e=h([w.Injectable(),g("design:paramtypes",[])],e)}();t.CommandCompiler=R;var x=function(){function e(e,t,r){this.component=e,this.componentTemplateFactory=t,this.changeDetectorFactories=r}return e.prototype._mapDirectives=function(e){return e.map(function(e){return e.type.runtime})},e.prototype.createText=function(e,t,r){return new y.TextCmd(e,t,r)},e.prototype.createNgContent=function(e,t){return new y.NgContentCmd(e,t)},e.prototype.createBeginElement=function(e,t,r,n,i,o,a){return new y.BeginElementCmd(e,t,r,n,this._mapDirectives(i),o,a)},e.prototype.createEndElement=function(){return new y.EndElementCmd},e.prototype.createBeginComponent=function(e,t,r,n,i,o,a){var s=this.componentTemplateFactory(i[0]);return new y.BeginComponentCmd(e,t,r,n,this._mapDirectives(i),o,a,s)},e.prototype.createEndComponent=function(){return new y.EndComponentCmd},e.prototype.createEmbeddedTemplate=function(e,t,r,n,i,o,a){return new y.EmbeddedTemplateCmd(t,r,this._mapDirectives(n),i,o,this.changeDetectorFactories[e],a)},e}(),O=function(){function e(e,t,r){this.component=e,this.componentTemplateFactory=t,this.changeDetectorFactoryExpressions=r}return e.prototype.createText=function(e,r,n){return new A(C.codeGenConstConstructorCall(t.TEMPLATE_COMMANDS_MODULE_REF+"TextCmd")+"("+C.escapeSingleQuoteString(e)+", "+r+", "+n+")")},e.prototype.createNgContent=function(e,r){return new A(C.codeGenConstConstructorCall(t.TEMPLATE_COMMANDS_MODULE_REF+"NgContentCmd")+"("+e+", "+r+")")},e.prototype.createBeginElement=function(e,r,n,i,o,a,s){var c=l(r);return new A(C.codeGenConstConstructorCall(t.TEMPLATE_COMMANDS_MODULE_REF+"BeginElementCmd")+"("+C.escapeSingleQuoteString(e)+", "+c+", "+(l(n)+", "+l(i)+", "+u(o)+", "+a+", "+s+")"))},e.prototype.createEndElement=function(){return new A(C.codeGenConstConstructorCall(t.TEMPLATE_COMMANDS_MODULE_REF+"EndElementCmd")+"()")},e.prototype.createBeginComponent=function(e,r,n,i,o,a,s){var c=l(r);return new A(C.codeGenConstConstructorCall(t.TEMPLATE_COMMANDS_MODULE_REF+"BeginComponentCmd")+"("+C.escapeSingleQuoteString(e)+", "+c+", "+(l(n)+", "+l(i)+", "+u(o)+", "+p(a)+", "+s+", "+this.componentTemplateFactory(o[0])+")"))},e.prototype.createEndComponent=function(){return new A(C.codeGenConstConstructorCall(t.TEMPLATE_COMMANDS_MODULE_REF+"EndComponentCmd")+"()")},e.prototype.createEmbeddedTemplate=function(e,r,n,i,o,a,s){return new A(C.codeGenConstConstructorCall(t.TEMPLATE_COMMANDS_MODULE_REF+"EmbeddedTemplateCmd")+"("+l(r)+", "+l(n)+", "+(u(i)+", "+o+", "+a+", "+this.changeDetectorFactoryExpressions[e]+", "+l(s)+")"))},e}(),D=function(){function e(e,t){this.commandFactory=e,this.embeddedTemplateIndex=t,this.result=[],this.transitiveNgContentCount=0}return e.prototype._readAttrNameAndValues=function(e,t){var r=o(n(this,t,[]));return e.forEach(function(e){v.StringMapWrapper.forEach(e.hostAttributes,function(e,t){var n=r[t];r[t]=m.isPresent(n)?s(t,n,e):e})}),a(r)},e.prototype.visitNgContent=function(e,t){return this.transitiveNgContentCount++,this.result.push(this.commandFactory.createNgContLine truncated
|
||||
function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/common/directives/ng_class");t.NgClass=a.NgClass;var s=e("angular2/src/common/directives/ng_for");t.NgFor=s.NgFor;var c=e("angular2/src/common/directives/ng_if");t.NgIf=c.NgIf;var l=e("angular2/src/common/directives/ng_style");t.NgStyle=l.NgStyle;var u=e("angular2/src/common/directives/ng_switch");t.NgSwitch=u.NgSwitch,t.NgSwitchWhen=u.NgSwitchWhen,t.NgSwitchDefault=u.NgSwitchDefault,n(e("angular2/src/common/directives/observable_list_diff"));var p=e("angular2/src/common/directives/core_directives");return t.CORE_DIRECTIVES=p.CORE_DIRECTIVES,i.define=o,r.exports}),System.register("angular2/src/common/forms/directives/shared",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/common/forms/validators","angular2/src/common/forms/directives/default_value_accessor","angular2/src/common/forms/directives/number_value_accessor","angular2/src/common/forms/directives/checkbox_value_accessor","angular2/src/common/forms/directives/select_control_value_accessor","angular2/src/common/forms/directives/normalize_validator"],!0,function(e,t,r){function n(e,t){var r=f.ListWrapper.clone(t.path);return r.push(e),r}function i(e,t){h.isBlank(e)&&a(t,"Cannot find control"),h.isBlank(t.valueAccessor)&&a(t,"No value accessor for"),e.validator=m.Validators.compose([e.validator,t.validator]),e.asyncValidator=m.Validators.composeAsync([e.asyncValidator,t.asyncValidator]),t.valueAccessor.writeValue(e.value),t.valueAccessor.registerOnChange(function(r){t.viewToModelUpdate(r),e.updateValue(r,{emitModelToViewChange:!1}),e.markAsDirty()}),e.registerOnChange(function(e){return t.valueAccessor.writeValue(e)}),t.valueAccessor.registerOnTouched(function(){return e.markAsTouched()})}function o(e,t){h.isBlank(e)&&a(t,"Cannot find control"),e.validator=m.Validators.compose([e.validator,t.validator]),e.asyncValidator=m.Validators.composeAsync([e.asyncValidator,t.asyncValidator])}function a(e,t){var r=e.path.join(" -> ");throw new g.BaseException(t+" '"+r+"'")}function s(e){return h.isPresent(e)?m.Validators.compose(e.map(C.normalizeValidator)):null}function c(e){return h.isPresent(e)?m.Validators.composeAsync(e.map(C.normalizeValidator)):null}function l(e,t){if(!f.StringMapWrapper.contains(e,"model"))return!1;var r=e.model;return r.isFirstChange()?!0:!h.looseIdentical(t,r.currentValue)}function u(e,t){if(h.isBlank(t))return null;var r,n,i;return t.forEach(function(t){t instanceof v.DefaultValueAccessor?r=t:t instanceof _.CheckboxControlValueAccessor||t instanceof y.NumberValueAccessor||t instanceof b.SelectControlValueAccessor?(h.isPresent(n)&&a(e,"More than one built-in value accessor matches"),n=t):(h.isPresent(i)&&a(e,"More than one custom value accessor matches"),i=t)}),h.isPresent(i)?i:h.isPresent(n)?n:h.isPresent(r)?r:(a(e,"No valid value accessor for"),null)}var p=System.global,d=p.define;p.define=void 0;var f=e("angular2/src/facade/collection"),h=e("angular2/src/facade/lang"),g=e("angular2/src/facade/exceptions"),m=e("angular2/src/common/forms/validators"),v=e("angular2/src/common/forms/directives/default_value_accessor"),y=e("angular2/src/common/forms/directives/number_value_accessor"),_=e("angular2/src/common/forms/directives/checkbox_value_accessor"),b=e("angular2/src/common/forms/directives/select_control_value_accessor"),C=e("angular2/src/common/forms/directives/normalize_validator");return t.controlPath=n,t.setUpControl=i,t.setUpControlGroup=o,t.composeValidators=s,t.composeAsyncValidators=c,t.isPropertyUpdated=l,t.selectValueAccessor=u,p.define=d,r.exports}),System.register("angular2/src/common/forms/directives",["angular2/src/facade/lang","angular2/src/common/forms/directives/ng_control_name","angular2/src/common/forms/directives/ng_form_control","angular2/src/common/forms/directives/ng_model","angular2/src/common/forms/directives/ng_control_group","angular2/src/common/forms/directives/ng_form_model","angular2/src/common/forms/directives/ng_form","angular2/src/common/forms/directives/default_value_accessor","angular2/src/common/forms/directives/checkbox_value_accessor","angular2/src/common/forms/directives/number_value_accessor","angular2/src/common/forms/directives/ng_control_status","angular2/src/common/forms/directives/select_control_value_accessor","angular2/src/common/forms/directives/validators","angular2/src/common/forms/directives/ng_control_name","angular2/src/common/forms/directives/ng_form_control","angular2/src/common/forms/directives/ng_model","angular2/src/common/forms/directives/ng_control_group","angular2/src/common/forms/directives/ng_form_model","angular2/src/common/forms/directives/ng_form","angular2/src/common/forms/directives/default_value_accessor","angular2/src/common/forms/directives/checkbox_value_accessor","angular2/src/common/forms/directives/number_value_accessor","angular2/src/common/forms/directives/ng_control_statusLine truncated
|
||||
this._beginToken(P.DOC_TYPE,e),this._attemptUntilChar(G),this._advance(),this._endToken([this.input.substring(e.offset+2,this.index-1)])},e.prototype._consumePrefixAndName=function(){for(var e=this.index,t=null;this.peek!==U&&!l(this.peek);)this._advance();var r;this.peek===U?(this._advance(),t=this.input.substring(e,this.index-1),r=this.index):r=e,this._requireUntilFn(c,this.index===r?1:0);var n=this.input.substring(r,this.index);return[t,n]},e.prototype._consumeTagOpen=function(e){var t,r=this._savePosition();try{if(!f(this.peek))throw this._createError(i(this.peek),this._getLocation());var n=this.index;for(this._consumeTagOpenStart(e),t=this.inputLowercase.substring(n,this.index),this._attemptUntilFn(a);this.peek!==B&&this.peek!==G;)this._consumeAttributeName(),this._attemptUntilFn(a),this._attemptChar(q)&&(this._attemptUntilFn(a),this._consumeAttributeValue()),this._attemptUntilFn(a);this._consumeTagOpenEnd()}catch(o){if(o instanceof re)return this._restorePosition(r),this._beginToken(P.TEXT,e),void this._endToken(["<"]);throw o}var s=w.getHtmlTagDefinition(t).contentType;s===w.HtmlTagContentType.RAW_TEXT?this._consumeRawTextWithTagClose(t,!1):s===w.HtmlTagContentType.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(t,!0)},e.prototype._consumeRawTextWithTagClose=function(e,t){var r=this,n=this._consumeRawText(t,H,function(){return r._attemptChar(B)?(r._attemptUntilFn(a),r._attemptChars(e)?(r._attemptUntilFn(a),r._attemptChar(G)?!0:!1):!1):!1});this._beginToken(P.TAG_CLOSE,n.sourceSpan.end),this._endToken([null,e])},e.prototype._consumeTagOpenStart=function(e){this._beginToken(P.TAG_OPEN_START,e);var t=this._consumePrefixAndName();this._endToken(t)},e.prototype._consumeAttributeName=function(){this._beginToken(P.ATTR_NAME);var e=this._consumePrefixAndName();this._endToken(e)},e.prototype._consumeAttributeValue=function(){this._beginToken(P.ATTR_VALUE);var e;if(this.peek===j||this.peek===k){var t=this.peek;this._advance();for(var r=[];this.peek!==t;)r.push(this._readChar(!0));e=r.join(""),this._advance()}else{var n=this.index;this._requireUntilFn(c,1),e=this.input.substring(n,this.index)}this._endToken([this._processCarriageReturns(e)])},e.prototype._consumeTagOpenEnd=function(){var e=this._attemptChar(B)?P.TAG_OPEN_END_VOID:P.TAG_OPEN_END;this._beginToken(e),this._requireChar(G),this._endToken([])},e.prototype._consumeTagClose=function(e){this._beginToken(P.TAG_CLOSE,e),this._attemptUntilFn(a);var t;t=this._consumePrefixAndName(),this._attemptUntilFn(a),this._requireChar(G),this._endToken(t)},e.prototype._consumeText=function(){var e=this._getLocation();this._beginToken(P.TEXT,e);for(var t=[this._readChar(!0)];!d(this.peek);)t.push(this._readChar(!0));this._endToken([this._processCarriageReturns(t.join(""))])},e.prototype._savePosition=function(){return[this.peek,this.index,this.column,this.line,this.tokens.length]},e.prototype._restorePosition=function(e){this.peek=e[0],this.index=e[1],this.column=e[2],this.line=e[3];var t=e[4];t<this.tokens.length&&(this.tokens=b.ListWrapper.slice(this.tokens,0,t))},e}();return m.define=v,r.exports}),System.register("angular2/src/common/pipes",["angular2/src/common/pipes/async_pipe","angular2/src/common/pipes/uppercase_pipe","angular2/src/common/pipes/lowercase_pipe","angular2/src/common/pipes/json_pipe","angular2/src/common/pipes/slice_pipe","angular2/src/common/pipes/date_pipe","angular2/src/common/pipes/number_pipe","angular2/src/facade/lang","angular2/src/common/pipes/async_pipe","angular2/src/common/pipes/date_pipe","angular2/src/common/pipes/json_pipe","angular2/src/common/pipes/slice_pipe","angular2/src/common/pipes/lowercase_pipe","angular2/src/common/pipes/number_pipe","angular2/src/common/pipes/uppercase_pipe"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/common/pipes/async_pipe"),a=e("angular2/src/common/pipes/uppercase_pipe"),s=e("angular2/src/common/pipes/lowercase_pipe"),c=e("angular2/src/common/pipes/json_pipe"),l=e("angular2/src/common/pipes/slice_pipe"),u=e("angular2/src/common/pipes/date_pipe"),p=e("angular2/src/common/pipes/number_pipe"),d=e("angular2/src/facade/lang"),f=e("angular2/src/common/pipes/async_pipe");t.AsyncPipe=f.AsyncPipe;var h=e("angular2/src/common/pipes/date_pipe");t.DatePipe=h.DatePipe;var g=e("angular2/src/common/pipes/json_pipe");t.JsonPipe=g.JsonPipe;var m=e("angular2/src/common/pipes/slice_pipe");t.SlicePipe=m.SlicePipe;var v=e("angular2/src/common/pipes/lowercase_pipe");t.LowerCasePipe=v.LowerCasePipe;var y=e("angular2/src/common/pipes/number_pipe");t.NumberPipe=y.NumberPipe,t.DecimalPipe=y.DecimalPipe,t.PercentPipe=y.PercentPipe,t.CurrencyPipe=y.CurrencyPipe;var _=e("angular2/src/common/pipes/uppercase_pipe");return t.UpperCasePipe=_.UpperCasePipe,t.COMMON_PIPES=d.CONST_EXPR([o.AsyncPipe,a.UpperCasePipe,s.LowerCasePipe,c.JsonPipe,l.SlicePipe,p.DecimalPipe,p.PercentPipe,p.CurrencyPipe,u.DatePipe]),n.define=i,r.exports}),System.register("angular2/src/common/forms/directives/ng_contLine truncated
|
||||
}return h.hasOwnProperty(t)&&(t=h[t]),t},t.prototype.getGlobalEventTarget=function(e){return"window"==e?window:"document"==e?document:"body"==e?document.body:void 0},t.prototype.getHistory=function(){return window.history},t.prototype.getLocation=function(){return window.location},t.prototype.getBaseHref=function(){var e=n();return l.isBlank(e)?null:i(e)},t.prototype.resetBaseElement=function(){v=null},t.prototype.getUserAgent=function(){return window.navigator.userAgent},t.prototype.setData=function(e,t,r){this.setAttribute(e,"data-"+t,r)},t.prototype.getData=function(e,t){return this.getAttribute(e,"data-"+t)},t.prototype.getComputedStyle=function(e){return getComputedStyle(e)},t.prototype.setGlobalVar=function(e,t){l.setValueOnPath(l.global,e,t)},t.prototype.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)},t.prototype.cancelAnimationFrame=function(e){window.cancelAnimationFrame(e)},t.prototype.performanceNow=function(){return l.isPresent(window.performance)&&l.isPresent(window.performance.now)?window.performance.now():l.DateWrapper.toMillis(l.DateWrapper.now())},t}(p.GenericBrowserDomAdapter);t.BrowserDomAdapter=m;var v=null,y=null;return o.define=a,r.exports}),System.register("angular2/src/compiler/template_parser",["angular2/src/facade/collection","angular2/src/facade/lang","angular2/core","angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/core/change_detection/change_detection","angular2/src/compiler/html_parser","angular2/src/compiler/html_tags","angular2/src/compiler/parse_util","angular2/src/compiler/template_ast","angular2/src/compiler/selector","angular2/src/compiler/schema/element_schema_registry","angular2/src/compiler/template_preparser","angular2/src/compiler/style_url_resolver","angular2/src/compiler/html_ast","angular2/src/compiler/util"],!0,function(e,t,r){function n(e){return d.StringWrapper.split(e.trim(),/\s+/g)}function i(e,t){var r=new C.CssSelector,i=y.splitNsName(e)[1];r.setElement(i);for(var o=0;o<t.length;o++){var a=t[o][0],s=y.splitNsName(a)[1],c=t[o][1];if(r.addAttribute(s,c),a.toLowerCase()==A){var l=n(c);l.forEach(function(e){return r.addClassName(e)})}}return r}var o=System.global,a=o.define;o.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=this&&this.__decorate||function(e,t,r,n){var i,o=arguments.length,a=3>o?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},l=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},u=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},p=e("angular2/src/facade/collection"),d=e("angular2/src/facade/lang"),f=e("angular2/core"),h=e("angular2/src/facade/lang"),g=e("angular2/src/facade/exceptions"),m=e("angular2/src/core/change_detection/change_detection"),v=e("angular2/src/compiler/html_parser"),y=e("angular2/src/compiler/html_tags"),_=e("angular2/src/compiler/parse_util"),b=e("angular2/src/compiler/template_ast"),C=e("angular2/src/compiler/selector"),w=e("angular2/src/compiler/schema/element_schema_registry"),P=e("angular2/src/compiler/template_preparser"),E=e("angular2/src/compiler/style_url_resolver"),S=e("angular2/src/compiler/html_ast"),R=e("angular2/src/compiler/util"),x=/^(?:(?:(?:(bind-)|(var-|#)|(on-)|(bindon-))(.+))|\[\(([^\)]+)\)\]|\[([^\]]+)\]|\(([^\)]+)\))$/g,O="template",D="template",T="*",A="class",I=".",k="attr",N="class",V="style",j=C.CssSelector.parse("*")[0];t.TEMPLATE_TRANSFORMS=h.CONST_EXPR(new f.OpaqueToken("TemplateTransforms"));var M=function(e){function t(t,r){e.call(this,r,t)}return s(t,e),t}(_.ParseError);t.TemplateParseError=M;var B=function(){function e(e,t,r,n){this._exprParser=e,this._schemaRegistry=t,this._htmlParser=r,this.transforms=n}return e.prototype.parse=function(e,t,r){var n=new L(t,this._exprParser,this._schemaRegistry),i=this._htmlParser.parse(e,r),o=S.htmlVisitAll(n,i.rootNodes,H),a=i.errors.concat(n.errors);if(a.length>0){var s=a.join("\n");throw new g.BaseException("Template parse errors:\n"+s)}return d.isPresent(this.transforms)&&this.transforms.forEach(function(e){o=b.templateVisitAll(e,o)}),o},e=c([f.Injectable(),u(3,f.Optional()),u(3,f.Inject(t.TEMPLATE_TRANSFORMS)),l("design:paramtypes",[m.Parser,w.ElementSchemaRegistry,v.HtmlParser,Array])],e)}();t.TemplateParser=B;var L=function(){function e(e,t,r){var n=this;this._exprParser=t,this._schemaRegistry=r,this.errors=[],this.directivesIndex=new Map,this.ngContentCount=0,this.selectorMatcher=new C.SelectorMatcher,p.ListWrapper.forEachWithIndex(e,function(e,t){var r=C.CssSelector.parse(e.selector);n.selectorMatcher.addSelectables(r,eLine truncated
|
||||
}),_.DomSharedStylesHost,d.Testability,C.BrowserDetails,w.AnimationBuilder,R.EventManager]),t.initDomAdapter=o,a.define=s,r.exports}),System.register("angular2/platform/browser",["angular2/src/core/angular_entrypoint","angular2/src/platform/browser_common","angular2/src/facade/lang","angular2/src/platform/browser_common","angular2/compiler","angular2/core","angular2/src/core/reflection/reflection_capabilities","angular2/src/platform/browser/xhr_impl","angular2/compiler","angular2/src/core/di"],!0,function(e,t,r){function n(e,r){p.reflector.reflectionCapabilities=new d.ReflectionCapabilities;var n=c.isPresent(r)?[t.BROWSER_APP_PROVIDERS,r]:t.BROWSER_APP_PROVIDERS;return p.platform(l.BROWSER_PROVIDERS).application(n).bootstrap(e)}var i=System.global,o=i.define;i.define=void 0;var a=e("angular2/src/core/angular_entrypoint");t.AngularEntrypoint=a.AngularEntrypoint;var s=e("angular2/src/platform/browser_common");t.BROWSER_PROVIDERS=s.BROWSER_PROVIDERS,t.ELEMENT_PROBE_BINDINGS=s.ELEMENT_PROBE_BINDINGS,t.ELEMENT_PROBE_PROVIDERS=s.ELEMENT_PROBE_PROVIDERS,t.inspectNativeElement=s.inspectNativeElement,t.BrowserDomAdapter=s.BrowserDomAdapter,t.By=s.By,t.Title=s.Title,t.DOCUMENT=s.DOCUMENT,t.enableDebugTools=s.enableDebugTools,t.disableDebugTools=s.disableDebugTools;var c=e("angular2/src/facade/lang"),l=e("angular2/src/platform/browser_common"),u=e("angular2/compiler"),p=e("angular2/core"),d=e("angular2/src/core/reflection/reflection_capabilities"),f=e("angular2/src/platform/browser/xhr_impl"),h=e("angular2/compiler"),g=e("angular2/src/core/di");return t.BROWSER_APP_PROVIDERS=c.CONST_EXPR([l.BROWSER_APP_COMMON_PROVIDERS,u.COMPILER_PROVIDERS,new g.Provider(h.XHR,{useClass:f.XHRImpl})]),t.bootstrap=n,i.define=o,r.exports}),System.register("angular2/instrumentation",["angular2/src/core/profile/profile"],!0,function(e,t,r){var n=System.global,i=n.define;n.define=void 0;var o=e("angular2/src/core/profile/profile");return t.wtfCreateScope=o.wtfCreateScope,t.wtfLeave=o.wtfLeave,t.wtfStartTimeRange=o.wtfStartTimeRange,t.wtfEndTimeRange=o.wtfEndTimeRange,n.define=i,r.exports});
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
/* */
|
||||
"format register";
|
||||
System.register("angular2/src/http/interfaces", [], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
+1083
File diff suppressed because it is too large.
Load diff
-1
@@ -1,2 +1 @@
|
||||
/* */
|
||||
"format register";System.register("angular2/src/http/interfaces",[],!0,function(e,t,r){var n=System.global,s=n.define;n.define=void 0;var a=function(){function e(){}return e}();t.ConnectionBackend=a;var o=function(){function e(){}return e}();return t.Connection=o,n.define=s,r.exports}),System.register("angular2/src/http/headers",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/facade/collection"],!0,function(e,t,r){var n=System.global,s=n.define;n.define=void 0;var a=e("angular2/src/facade/lang"),o=e("angular2/src/facade/exceptions"),i=e("angular2/src/facade/collection"),c=function(){function e(t){var r=this;return t instanceof e?void(this._headersMap=t._headersMap):(this._headersMap=new i.Map,void(a.isBlank(t)||i.StringMapWrapper.forEach(t,function(e,t){r._headersMap.set(t,i.isListLikeIterable(e)?e:[e])})))}return e.fromResponseHeaderString=function(t){return t.trim().split("\n").map(function(e){return e.split(":")}).map(function(e){var t=e[0],r=e.slice(1);return[t.trim(),r.join(":").trim()]}).reduce(function(e,t){var r=t[0],n=t[1];return!e.set(r,n)&&e},new e)},e.prototype.append=function(e,t){var r=this._headersMap.get(e),n=i.isListLikeIterable(r)?r:[];n.push(t),this._headersMap.set(e,n)},e.prototype["delete"]=function(e){this._headersMap["delete"](e)},e.prototype.forEach=function(e){this._headersMap.forEach(e)},e.prototype.get=function(e){return i.ListWrapper.first(this._headersMap.get(e))},e.prototype.has=function(e){return this._headersMap.has(e)},e.prototype.keys=function(){return i.MapWrapper.keys(this._headersMap)},e.prototype.set=function(e,t){var r=[];if(i.isListLikeIterable(t)){var n=t.join(",");r.push(n)}else r.push(t);this._headersMap.set(e,r)},e.prototype.values=function(){return i.MapWrapper.values(this._headersMap)},e.prototype.toJSON=function(){return a.Json.stringify(this.values())},e.prototype.getAll=function(e){var t=this._headersMap.get(e);return i.isListLikeIterable(t)?t:[]},e.prototype.entries=function(){throw new o.BaseException('"entries" method is not implemented on Headers class')},e}();return t.Headers=c,n.define=s,r.exports}),System.register("angular2/src/http/enums",[],!0,function(e,t,r){var n=System.global,s=n.define;return n.define=void 0,function(e){e[e.Get=0]="Get",e[e.Post=1]="Post",e[e.Put=2]="Put",e[e.Delete=3]="Delete",e[e.Options=4]="Options",e[e.Head=5]="Head",e[e.Patch=6]="Patch"}(t.RequestMethod||(t.RequestMethod={})),t.RequestMethod,!function(e){e[e.Unsent=0]="Unsent",e[e.Open=1]="Open",e[e.HeadersReceived=2]="HeadersReceived",e[e.Loading=3]="Loading",e[e.Done=4]="Done",e[e.Cancelled=5]="Cancelled"}(t.ReadyState||(t.ReadyState={})),t.ReadyState,!function(e){e[e.Basic=0]="Basic",e[e.Cors=1]="Cors",e[e.Default=2]="Default",e[e.Error=3]="Error",e[e.Opaque=4]="Opaque"}(t.ResponseType||(t.ResponseType={})),t.ResponseType,n.define=s,r.exports}),System.register("angular2/src/http/url_search_params",["angular2/src/facade/lang","angular2/src/facade/collection"],!0,function(e,t,r){function n(e){void 0===e&&(e="");var t=new i.Map;if(e.length>0){var r=e.split("&");r.forEach(function(e){var r=e.split("="),n=r[0],s=r[1],a=o.isPresent(t.get(n))?t.get(n):[];a.push(s),t.set(n,a)})}return t}var s=System.global,a=s.define;s.define=void 0;var o=e("angular2/src/facade/lang"),i=e("angular2/src/facade/collection"),c=function(){function e(e){void 0===e&&(e=""),this.rawParams=e,this.paramsMap=n(e)}return e.prototype.clone=function(){var t=new e;return t.appendAll(this),t},e.prototype.has=function(e){return this.paramsMap.has(e)},e.prototype.get=function(e){var t=this.paramsMap.get(e);return i.isListLikeIterable(t)?i.ListWrapper.first(t):null},e.prototype.getAll=function(e){var t=this.paramsMap.get(e);return o.isPresent(t)?t:[]},e.prototype.set=function(e,t){var r=this.paramsMap.get(e),n=o.isPresent(r)?r:[];i.ListWrapper.clear(n),n.push(t),this.paramsMap.set(e,n)},e.prototype.setAll=function(e){var t=this;e.paramsMap.forEach(function(e,r){var n=t.paramsMap.get(r),s=o.isPresent(n)?n:[];i.ListWrapper.clear(s),s.push(e[0]),t.paramsMap.set(r,s)})},e.prototype.append=function(e,t){var r=this.paramsMap.get(e),n=o.isPresent(r)?r:[];n.push(t),this.paramsMap.set(e,n)},e.prototype.appendAll=function(e){var t=this;e.paramsMap.forEach(function(e,r){for(var n=t.paramsMap.get(r),s=o.isPresent(n)?n:[],a=0;a<e.length;++a)s.push(e[a]);t.paramsMap.set(r,s)})},e.prototype.replaceAll=function(e){var t=this;e.paramsMap.forEach(function(e,r){var n=t.paramsMap.get(r),s=o.isPresent(n)?n:[];i.ListWrapper.clear(s);for(var a=0;a<e.length;++a)s.push(e[a]);t.paramsMap.set(r,s)})},e.prototype.toString=function(){var e=[];return this.paramsMap.forEach(function(t,r){t.forEach(function(t){return e.push(r+"="+t)})}),e.join("&")},e.prototype["delete"]=function(e){this.paramsMap["delete"](e)},e}();return t.URLSearchParams=c,s.define=a,r.exports}),System.register("angular2/src/http/static_response",["angular2/src/facade/lang","angular2/src/facade/exceptions","angular2/src/http/http_utils"],!0,functioLine truncated
|
||||
File renamed without changes.
+1
-2
@@ -1,4 +1,3 @@
|
||||
/* */
|
||||
"format register";
|
||||
System.register("angular2/src/router/router_link_transform", ["angular2/compiler", "angular2/src/core/change_detection/parser/ast", "angular2/src/facade/exceptions", "angular2/core", "angular2/src/core/change_detection/parser/parser"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
@@ -233,7 +232,7 @@ System.register("angular2/router/router_link_dsl", ["angular2/compiler", "angula
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
var router_link_transform_2 = require("angular2/src/router/router_link_transform");
|
||||
exports.RouterLinkTransform = router_link_transform_2.RouterLinkTransform;
|
||||
var ROUTER_LINK_DSL_PROVIDER = lang_1.CONST_EXPR(new core_1.Provider(compiler_1.TEMPLATE_TRANSFORMS, {
|
||||
exports.ROUTER_LINK_DSL_PROVIDER = lang_1.CONST_EXPR(new core_1.Provider(compiler_1.TEMPLATE_TRANSFORMS, {
|
||||
useClass: router_link_transform_1.RouterLinkTransform,
|
||||
multi: true
|
||||
}));
|
||||
+2972
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,3 @@
|
||||
"format register";System.register("angular2/src/router/router_link_transform",["angular2/compiler","angular2/src/core/change_detection/parser/ast","angular2/src/facade/exceptions","angular2/core","angular2/src/core/change_detection/parser/parser"],!0,function(t,e,r){function n(t,e){var r=new _(t,e.trim()).tokenize();return new v(r).generate()}var o=System.global,a=o.define;o.define=void 0;var i=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},s=this&&this.__decorate||function(t,e,r,n){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},u=this&&this.__metadata||function(t,e){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(t,e):void 0},c=t("angular2/compiler"),l=t("angular2/src/core/change_detection/parser/ast"),p=t("angular2/src/facade/exceptions"),f=t("angular2/core"),h=t("angular2/src/core/change_detection/parser/parser"),g=function(){function t(t){this.value=t}return t}(),m=function(){function t(){}return t}(),d=function(){function t(){}return t}(),y=function(){function t(t){this.ast=t}return t}(),_=function(){function t(t,e){this.parser=t,this.exp=e,this.index=0}return t.prototype.tokenize=function(){for(var t=[];this.index<this.exp.length;)t.push(this._parseToken());return t},t.prototype._parseToken=function(){var t=this.exp[this.index];return"["==t?(this.index++,new m):"]"==t?(this.index++,new d):"("==t?this._parseParams():"/"==t&&0!==this.index?(this.index++,this._parseFixedPart()):this._parseFixedPart()},t.prototype._parseParams=function(){for(var t=this.index;this.index<this.exp.length;++this.index){var e=this.exp[this.index];if(")"==e){var r=this.exp.substring(t+1,this.index);return this.index++,new y(this.parser.parseBinding("{"+r+"}",null).ast)}}throw new p.BaseException("Cannot find ')'")},t.prototype._parseFixedPart=function(){for(var t=this.index,e=!1;this.index<this.exp.length;++this.index){var r=this.exp[this.index];if("("==r||"["==r||"]"==r||"/"==r&&e)break;"."!=r&&"/"!=r&&(e=!0)}var n=this.exp.substring(t,this.index);if(t===this.index||!e||n.startsWith("//"))throw new p.BaseException("Invalid router link");return new g(n)},t}(),v=function(){function t(t){this.tokens=t,this.index=0}return t.prototype.generate=function(){return this._genAuxiliary()},t.prototype._genAuxiliary=function(){for(var t=[];this.index<this.tokens.length;this.index++){var e=this.tokens[this.index];if(e instanceof g)t.push(new l.LiteralPrimitive(e.value));else if(e instanceof y)t.push(e.ast);else{if(e instanceof d)break;e instanceof m&&(this.index++,t.push(this._genAuxiliary()))}}return new l.LiteralArray(t)},t}(),R=function(t){function e(e){t.call(this),this.parser=e}return i(e,t),e.prototype.visitQuote=function(e){return"route"==e.prefix?n(this.parser,e.uninterpretedExpression):t.prototype.visitQuote.call(this,e)},e}(l.AstTransformer);e.parseRouterLinkExpression=n;var P=function(){function t(t){this.astTransformer=new R(t)}return t.prototype.visitNgContent=function(t,e){return t},t.prototype.visitEmbeddedTemplate=function(t,e){return t},t.prototype.visitElement=function(t,e){var r=this,n=t.children.map(function(t){return t.visit(r,e)}),o=t.inputs.map(function(t){return t.visit(r,e)}),a=t.directives.map(function(t){return t.visit(r,e)});return new c.ElementAst(t.name,t.attrs,o,t.outputs,t.exportAsVars,a,n,t.ngContentIndex,t.sourceSpan)},t.prototype.visitVariable=function(t,e){return t},t.prototype.visitEvent=function(t,e){return t},t.prototype.visitElementProperty=function(t,e){return t},t.prototype.visitAttr=function(t,e){return t},t.prototype.visitBoundText=function(t,e){return t},t.prototype.visitText=function(t,e){return t},t.prototype.visitDirective=function(t,e){var r=this,n=t.inputs.map(function(t){return t.visit(r,e)});return new c.DirectiveAst(t.directive,n,t.hostProperties,t.hostEvents,t.exportAsVars,t.sourceSpan)},t.prototype.visitDirectiveProperty=function(t,e){var r=t.value.visit(this.astTransformer);return new c.BoundDirectivePropertyAst(t.directiveName,t.templateName,r,t.sourceSpan)},t=s([f.Injectable(),u("design:paramtypes",[h.Parser])],t)}();return e.RouterLinkTransform=P,o.define=a,r.exports}),System.register("angular2/router/router_link_dsl",["angular2/compiler","angular2/core","angular2/src/router/router_link_transform","angular2/src/facade/lang","angular2/src/router/router_link_transform"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var a=t("angular2/compiler"),i=t("angular2/core"),s=t("angular2/src/router/router_link_transform"),u=t("angular2/src/facade/lang"),c=t("angular2/src/router/router_link_transform");return e.RouterLinkTransform=c.RouterLinkTranLine truncated
|
||||
this.auxNames=new s.Map,this.auxRoutes=new s.Map,this.matchers=[],this.defaultRoute=null}return t.prototype.config=function(t){var e;if(a.isPresent(t.name)&&t.name[0].toUpperCase()!=t.name[0]){var r=t.name[0].toUpperCase()+t.name.substring(1);throw new i.BaseException('Route "'+t.path+'" with name "'+t.name+'" does not begin with an uppercase letter. Route names should be CamelCase like "'+r+'".')}if(t instanceof l.AuxRoute){e=new f.SyncRouteHandler(t.component,t.data);var n=t.path.startsWith("/")?t.path.substring(1):t.path,o=new c.RouteRecognizer(t.path,e);return this.auxRoutes.set(n,o),a.isPresent(t.name)&&this.auxNames.set(t.name,o),o.terminal}var s=!1;if(t instanceof l.Redirect){var u=new c.RedirectRecognizer(t.path,t.redirectTo);return this._assertNoHashCollision(u.hash,t.path),this.matchers.push(u),!0}t instanceof l.Route?(e=new f.SyncRouteHandler(t.component,t.data),s=a.isPresent(t.useAsDefault)&&t.useAsDefault):t instanceof l.AsyncRoute&&(e=new p.AsyncRouteHandler(t.loader,t.data),s=a.isPresent(t.useAsDefault)&&t.useAsDefault);var o=new c.RouteRecognizer(t.path,e);if(this._assertNoHashCollision(o.hash,t.path),s){if(a.isPresent(this.defaultRoute))throw new i.BaseException("Only one route can be default");this.defaultRoute=o}return this.matchers.push(o),a.isPresent(t.name)&&this.names.set(t.name,o),o.terminal},t.prototype._assertNoHashCollision=function(t,e){this.matchers.forEach(function(r){if(t==r.hash)throw new i.BaseException("Configuration '"+e+"' conflicts with existing route '"+r.path+"'")})},t.prototype.recognize=function(t){var e=[];return this.matchers.forEach(function(r){var n=r.recognize(t);a.isPresent(n)&&e.push(n)}),e},t.prototype.recognizeAuxiliary=function(t){var e=this.auxRoutes.get(t.path);return a.isPresent(e)?[e.recognize(t)]:[u.PromiseWrapper.resolve(null)]},t.prototype.hasRoute=function(t){return this.names.has(t)},t.prototype.componentLoaded=function(t){return this.hasRoute(t)&&a.isPresent(this.names.get(t).handler.componentType)},t.prototype.loadComponent=function(t){return this.names.get(t).handler.resolveComponentType()},t.prototype.generate=function(t,e){var r=this.names.get(t);return a.isBlank(r)?null:r.generate(e)},t.prototype.generateAuxiliary=function(t,e){var r=this.auxNames.get(t);return a.isBlank(r)?null:r.generate(e)},t}();return e.ComponentRecognizer=h,n.define=o,r.exports}),System.register("angular2/src/router/route_config_nomalizer",["angular2/src/router/route_config_decorator","angular2/src/facade/lang","angular2/src/facade/exceptions"],!0,function(t,e,r){function n(t,e){if(t instanceof u.AsyncRoute){var r=o(t.loader,e);return new u.AsyncRoute({path:t.path,loader:r,name:t.name,data:t.data,useAsDefault:t.useAsDefault})}if(t instanceof u.Route||t instanceof u.Redirect||t instanceof u.AuxRoute)return t;if(+!!t.component+ +!!t.redirectTo+ +!!t.loader!=1)throw new l.BaseException('Route config should contain exactly one "component", "loader", or "redirectTo" property.');if(t.as&&t.name)throw new l.BaseException('Route config should contain exactly one "as" or "name" property.');if(t.as&&(t.name=t.as),t.loader){var r=o(t.loader,e);return new u.AsyncRoute({path:t.path,loader:r,name:t.name,useAsDefault:t.useAsDefault})}if(t.aux)return new u.AuxRoute({path:t.aux,component:t.component,name:t.name});if(t.component){if("object"==typeof t.component){var n=t.component;if("constructor"==n.type)return new u.Route({path:t.path,component:n.constructor,name:t.name,data:t.data,useAsDefault:t.useAsDefault});if("loader"==n.type)return new u.AsyncRoute({path:t.path,loader:n.loader,name:t.name,useAsDefault:t.useAsDefault});throw new l.BaseException('Invalid component type "'+n.type+'". Valid types are "constructor" and "loader".')}return new u.Route(t)}return t.redirectTo?new u.Redirect({path:t.path,redirectTo:t.redirectTo}):t}function o(t,e){return function(){return t().then(function(t){return e.configFromComponent(t),t})}}function a(t,e){if(!c.isType(t))throw new l.BaseException('Component for route "'+e+'" is not defined, or is not a class.')}var i=System.global,s=i.define;i.define=void 0;var u=t("angular2/src/router/route_config_decorator"),c=t("angular2/src/facade/lang"),l=t("angular2/src/facade/exceptions");return e.normalizeRouteConfig=n,e.assertComponentExists=a,i.define=s,r.exports}),System.register("angular2/src/router/location",["angular2/src/router/location_strategy","angular2/src/facade/async","angular2/core"],!0,function(t,e,r){function n(t,e){return t.length>0&&e.startsWith(t)?e.substring(t.length):e}function o(t){return/\/index.html$/g.test(t)?t.substring(0,t.length-11):t}function a(t){return/\/$/g.test(t)&&(t=t.substring(0,t.length-1)),t}var i=System.global,s=i.define;i.define=void 0;var u=this&&this.__decorate||function(t,e,r,n){var o,a=arguments.length,i=3>a?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(i=(3>a?o(i):a>3?o(e,rLine truncated
|
||||
function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}function o(t,e,r,n){var o=new b.RootRouter(t,e,r);return n.registerDisposeListener(function(){return o.dispose()}),o}function a(t){if(0==t.componentTypes.length)throw new k.BaseException("Bootstrap at least one component before injecting Router.");return t.componentTypes[0]}var i=System.global,s=i.define;i.define=void 0;var u=t("angular2/src/router/router");e.Router=u.Router;var c=t("angular2/src/router/router_outlet");e.RouterOutlet=c.RouterOutlet;var l=t("angular2/src/router/router_link");e.RouterLink=l.RouterLink;var p=t("angular2/src/router/instruction");e.RouteParams=p.RouteParams,e.RouteData=p.RouteData;var f=t("angular2/src/router/platform_location");e.PlatformLocation=f.PlatformLocation;var h=t("angular2/src/router/route_registry");e.RouteRegistry=h.RouteRegistry,e.ROUTER_PRIMARY_COMPONENT=h.ROUTER_PRIMARY_COMPONENT;var g=t("angular2/src/router/location_strategy");e.LocationStrategy=g.LocationStrategy,e.APP_BASE_HREF=g.APP_BASE_HREF;var m=t("angular2/src/router/hash_location_strategy");e.HashLocationStrategy=m.HashLocationStrategy;var d=t("angular2/src/router/path_location_strategy");e.PathLocationStrategy=d.PathLocationStrategy;var y=t("angular2/src/router/location");e.Location=y.Location,n(t("angular2/src/router/route_config_decorator")),n(t("angular2/src/router/route_definition"));var _=t("angular2/src/router/lifecycle_annotations");e.CanActivate=_.CanActivate;var v=t("angular2/src/router/instruction");e.Instruction=v.Instruction,e.ComponentInstruction=v.ComponentInstruction;var R=t("angular2/core");e.OpaqueToken=R.OpaqueToken;var P=t("angular2/src/router/platform_location"),x=t("angular2/src/router/location_strategy"),S=t("angular2/src/router/path_location_strategy"),b=t("angular2/src/router/router"),w=t("angular2/src/router/router_outlet"),O=t("angular2/src/router/router_link"),T=t("angular2/src/router/route_registry"),E=t("angular2/src/router/location"),C=t("angular2/core"),A=t("angular2/src/facade/lang"),k=t("angular2/src/facade/exceptions");return e.ROUTER_DIRECTIVES=A.CONST_EXPR([w.RouterOutlet,O.RouterLink]),e.ROUTER_PROVIDERS=A.CONST_EXPR([T.RouteRegistry,A.CONST_EXPR(new C.Provider(x.LocationStrategy,{useClass:S.PathLocationStrategy})),P.PlatformLocation,E.Location,A.CONST_EXPR(new C.Provider(b.Router,{useFactory:o,deps:A.CONST_EXPR([T.RouteRegistry,E.Location,T.ROUTER_PRIMARY_COMPONENT,C.ApplicationRef])})),A.CONST_EXPR(new C.Provider(T.ROUTER_PRIMARY_COMPONENT,{useFactory:a,deps:A.CONST_EXPR([C.ApplicationRef])}))]),e.ROUTER_BINDINGS=e.ROUTER_PROVIDERS,i.define=s,r.exports});
|
||||
+4
-5
@@ -1,4 +1,3 @@
|
||||
/* */
|
||||
"format register";
|
||||
System.register("angular2/src/mock/location_mock", ["angular2/src/core/di", "angular2/src/facade/async"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
@@ -193,7 +192,7 @@ System.register("angular2/src/mock/mock_location_strategy", ["angular2/src/core/
|
||||
}
|
||||
MockLocationStrategy.prototype.simulatePopState = function(url) {
|
||||
this.internalPath = url;
|
||||
async_1.ObservableWrapper.callEmit(this._subject, new MockPopStateEvent(this.path()));
|
||||
async_1.ObservableWrapper.callEmit(this._subject, new _MockPopStateEvent(this.path()));
|
||||
};
|
||||
MockLocationStrategy.prototype.path = function() {
|
||||
return this.internalPath;
|
||||
@@ -238,13 +237,13 @@ System.register("angular2/src/mock/mock_location_strategy", ["angular2/src/core/
|
||||
return MockLocationStrategy;
|
||||
})(location_strategy_1.LocationStrategy);
|
||||
exports.MockLocationStrategy = MockLocationStrategy;
|
||||
var MockPopStateEvent = (function() {
|
||||
function MockPopStateEvent(newUrl) {
|
||||
var _MockPopStateEvent = (function() {
|
||||
function _MockPopStateEvent(newUrl) {
|
||||
this.newUrl = newUrl;
|
||||
this.pop = true;
|
||||
this.type = 'popstate';
|
||||
}
|
||||
return MockPopStateEvent;
|
||||
return _MockPopStateEvent;
|
||||
})();
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../dev/es5/angular2/src/mock/location_mock.js","../dev/es5/angular2/src/router/location_strategy.js","../dev/es5/angular2/src/mock/mock_location_strategy.js","../dev/es5/angular2/router/testing.js","../dev/es5/angular2/src/http/headers.js","../dev/es5/angular2/src/http/enums.js","../dev/es5/angular2/src/http/http_utils.js","../dev/es5/angular2/src/http/static_request.js","../dev/es5/angular2/src/http/backends/mock_backend.js","../dev/es5/angular2/http/testing.js","../dev/es5/angular2/src/mock/animation_builder_mock.js","../dev/es5/angular2/src/mock/directive_resolver_mock.js","../dev/es5/angular2/src/mock/view_resolver_mock.js","../dev/es5/angular2/src/mock/ng_zone_mock.js","../dev/es5/angular2/src/testing/utils.js","../dev/es5/angular2/src/web_workers/shared/api.js","../dev/es5/angular2/src/web_workers/shared/render_proto_view_ref_store.js","../dev/es5/angular2/src/web_workers/shared/render_view_with_fragments_store.js","../dev/es5/angular2/src/testing/matchers.js","../dev/es5/angular2/src/testing/fake_async.js","../dev/es5/angular2/src/compiler/xhr_mock.js","../dev/es5/angular2/src/mock/mock_application_ref.js","../dev/es5/angular2/src/testing/test_component_builder.js","../dev/es5/angular2/src/web_workers/shared/serializer.js","../dev/es5/angular2/src/testing/test_injector.js","../dev/es5/angular2/src/testing/testing.js","../dev/es5/angular2/testing.js"],"names":[],"mappings":";AAAA,KAAK,SAAS,AAAC,CAAC,iCAAgC,CAAG,EAAC,sBAAqB,CAAE,4BAA0B,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAA/I,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,UAAS,CAAG,CAAA,MAAK,CAAG,CAAA,GAAE,CAAG,CAAA,IAAG,CAAG;AACnF,AAAI,MAAA,CAAA,CAAA,EAAI,CAAA,SAAQ,OAAO;AAAG,QAAA,EAAI,CAAA,CAAA,EAAI,EAAA,CAAA,CAAI,OAAK,EAAI,CAAA,IAAG,IAAM,KAAG,CAAA,CAAI,CAAA,IAAG,EAAI,CAAA,MAAK,yBAAyB,AAAC,CAAC,MAAK,CAAG,IAAE,CAAC,CAAA,CAAI,KAAG;AAAG,QAAA,CAAC;AAC5H,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,MAAA,EAAI,CAAA,OAAM,SAAS,AAAC,CAAC,UAAS,CAAG,OAAK,CAAG,IAAE,CAAG,KAAG,CAAC,CAAC;;AACzH,UAAS,GAAA,CAAA,CAAA,EAAI,CAAA,UAAS,OAAO,EAAI,EAAA,CAAG,CAAA,CAAA,GAAK,EAAA,CAAG,CAAA,CAAA,EAAE;AAAG,WAAI,CAAA,EAAI,CAAA,UAAS,CAAE,CAAA,CAAC;AAAG,UAAA,EAAI,CAAA,CAAC,CAAA,EAAI,EAAA,CAAA,CAAI,CAAA,CAAA,AAAC,CAAC,CAAA,CAAC,CAAA,CAAI,CAAA,CAAA,EAAI,EAAA,CAAA,CAAI,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAG,EAAA,CAAC,CAAA,CAAI,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAC,CAAC,GAAK,EAAA,CAAC;AAAA,AACjJ,SAAO,CAAA,CAAA,EAAI,EAAA,CAAA,EAAK,EAAA,CAAA,EAAK,CAAA,MAAK,eAAe,AAAC,CAAC,MAAK,CAAG,IAAE,CAAG,EAAA,CAAC,CAAG,EAAA,CAAC;EACjE,CAAC;AACD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AAC1D,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,CAAA,CAAG,EAAA,CAAC,CAAC;AAAA,EAC5G,CAAC;AACD,AAAI,IAAA,CAAA,IAAG,EAAI,CAAA,OAAM,AAAC,CAAC,sBAAqB,CAAC,CAAC;AAC1C,AAAI,IAAA,CAAA,OAAM,EAAI,CAAA,OAAM,AAAC,CAAC,2BAA0B,CAAC,CAAC;AAIlD,AAAI,IAAA,CAAA,WAAU,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAC3B,WAAS,YAAU,CAAC,AAAC,CAAE;AACnB,SAAG,WAAW,EAAI,GAAC,CAAC;AAEpB,SAAG,MAAM,EAAI,GAAC,CAAC;AAEf,SAAG,OAAO,EAAI,GAAC,CAAC;AAEhB,SAAG,SAAS,EAAI,IAAI,CAAA,OAAM,aAAa,AAAC,EAAC,CAAC;AAE1C,SAAG,UAAU,EAAI,GAAC,CAAC;AAEnB,SAAG,iBAAiB,EAAI,KAAG,CAAC;IAChC;AAAA,AACA,cAAU,UAAU,eAAe,EAAI,UAAU,GAAE,CAAG;AAAE,SAAG,MAAM,EAAI,IAAE,CAAC;IAAE,CAAC;AAC3E,cAAU,UAAU,YAAY,EAAI,UAAU,GAAE,CAAG;AAAE,SAAG,UAAU,EAAI,IAAE,CAAC;IAAE,CAAC;AAC5E,cAAU,UAAU,KAAK,EAAI,UAAS,AAAC,CAAE;AAAE,WAAO,CAAA,IAAG,MAAM,CAAC;IAAE,CAAC;AAC/D,cAAU,UAAU,eAAe,EAAI,UAAU,QAAO,CAAG;AACvD,YAAM,kBAAkB,SAAS,AAAC,CAAC,IAAG,SAAS,CAAG;AAAE,YAAI,CAAG,SAAO;AAAG,YAAI,CAAG,KAAG;AAAA,MAAE,CAAC,CAAC;IACvF,CAAC;AACD,cAAU,UAAU,mBAAmB,EAAI,UAAU,QAAO,CAAG;AAE3D,SAAG,eAAe,AAAC,CAAC,QAAO,CAAC,CAAC;AAC7B,SAAG,WAAW,KAAK,AAAC,CAAC,QAAO,EAAI,SAAO,CAAC,CAAC;AACzC,YAAM,kBAAkB,SAAS,AAAC,CAAC,IAAG,SAAS,CAAG;AAAE,YAAI,CAAG,SAAO;AAAG,YAAI,CAAG,KAAG;AAAG,aAAK,CAAG,aAAW;AAAA,MAAE,CAAC,CAAC;IAC7G,CAAC;AACD,cAAU,UAAU,mBAAmB,EAAI,UAAU,GAAE,CAAG;AACtD,SAAI,GAAE,OAAO,EAAI,EAAA,CAAA,EAAK,EAAC,GAAE,WAAW,AAAC,CAAC,GAAE,CAAC,CAAG;AACxC,UAAE,EAAI,CAAA,GAAE,EAAI,IAAE,CAAC;MACnB;AAAA,AACA,WAAO,CAAA,IAAG,UAAU,EAAI,IAAE,CAAC;IAC/B,CAAC;AACD,cAAU,UAAU,GAAG,EAAI,UAAU,IAAG,CAAG,CAAA,KAAI,CAAG;AAC9C,SAAI,KAAI,IAAM,KAAK,EAAA,CAAG;AAAE,YAAI,EAAI,GAAC,CAAC;MAAE;AAAA,AACpC,SAAG,EAAI,CAAA,IAAG,mBAAmB,AAAC,CAAC,IAAG,CAAC,CAAC;AACpC,SAAI,IAAG,MAAM,GAAK,KAAG,CAAA,EAAK,CAAA,IAAG,OAAO,GAAK,MAAI,CAAG;AAC5C,eAAM;MACV;AAAA,AACA,SAAG,MAAM,EAAI,KAAG,CAAC;AACjB,SAAG,OAAO,EAAI,MAAI,CAAC;AACnB,AAAI,QAAA,CAAA,GAAE,EAAI,CAAA,IAAG,EAAI,EAAC,KAAI,OAAO,EAAI,EAAA,CAAA,CAAI,EAAC,GAAE,EAAI,MAAI,CAAC,EAAI,GAAC,CAAC,CAAC;AACxD,SAAG,WAAW,KAAK,AAAC,CAAC,GAAE,CAAC,CAAC;IAC7B,CAAC;AACD,cAAU,UAAU,aAAa,EAAI,UAAU,IAAG,CAAG,CAAA,KAAI,CAAG;AACxD,SAAI,KAAI,IAAM,KAAK,EAAA,CAAG;AAAE,YAAI,EAAI,GAAC,CAAC;MAAE;AAAA,AACpC,SAAG,EAAI,CAAA,IAALine truncated
|
||||
{"version":3,"sources":["../dev/es5/angular2/src/mock/location_mock.js","../dev/es5/angular2/src/router/location_strategy.js","../dev/es5/angular2/src/mock/mock_location_strategy.js","../dev/es5/angular2/router/testing.js","../dev/es5/angular2/src/http/headers.js","../dev/es5/angular2/src/http/enums.js","../dev/es5/angular2/src/http/http_utils.js","../dev/es5/angular2/src/http/static_request.js","../dev/es5/angular2/src/http/backends/mock_backend.js","../dev/es5/angular2/http/testing.js","../dev/es5/angular2/src/mock/animation_builder_mock.js","../dev/es5/angular2/src/mock/directive_resolver_mock.js","../dev/es5/angular2/src/mock/view_resolver_mock.js","../dev/es5/angular2/src/mock/ng_zone_mock.js","../dev/es5/angular2/src/testing/utils.js","../dev/es5/angular2/src/web_workers/shared/api.js","../dev/es5/angular2/src/web_workers/shared/render_proto_view_ref_store.js","../dev/es5/angular2/src/web_workers/shared/render_view_with_fragments_store.js","../dev/es5/angular2/src/testing/matchers.js","../dev/es5/angular2/src/testing/fake_async.js","../dev/es5/angular2/src/compiler/xhr_mock.js","../dev/es5/angular2/src/mock/mock_application_ref.js","../dev/es5/angular2/src/testing/test_component_builder.js","../dev/es5/angular2/src/web_workers/shared/serializer.js","../dev/es5/angular2/src/testing/test_injector.js","../dev/es5/angular2/src/testing/testing.js","../dev/es5/angular2/testing.js"],"names":[],"mappings":";AAAA,KAAK,SAAS,AAAC,CAAC,iCAAgC,CAAG,EAAC,sBAAqB,CAAE,4BAA0B,CAAC,CAAG,KAAG,CAAG,UAAS,OAAM,CAAG,CAAA,OAAM,CAAG,CAAA,MAAK;AAA/I,AAAI,IAAA,CAAA,MAAK,EAAI,CAAA,MAAK,OAAO;AAAG,aAAO,EAAI,CAAA,MAAK,OAAO,CAAC;AACpD,OAAK,OAAO,EAAI,UAAQ,CAAC;AADzB,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,UAAS,CAAG,CAAA,MAAK,CAAG,CAAA,GAAE,CAAG,CAAA,IAAG,CAAG;AACnF,AAAI,MAAA,CAAA,CAAA,EAAI,CAAA,SAAQ,OAAO;AAAG,QAAA,EAAI,CAAA,CAAA,EAAI,EAAA,CAAA,CAAI,OAAK,EAAI,CAAA,IAAG,IAAM,KAAG,CAAA,CAAI,CAAA,IAAG,EAAI,CAAA,MAAK,yBAAyB,AAAC,CAAC,MAAK,CAAG,IAAE,CAAC,CAAA,CAAI,KAAG;AAAG,QAAA,CAAC;AAC5H,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,MAAA,EAAI,CAAA,OAAM,SAAS,AAAC,CAAC,UAAS,CAAG,OAAK,CAAG,IAAE,CAAG,KAAG,CAAC,CAAC;;AACzH,UAAS,GAAA,CAAA,CAAA,EAAI,CAAA,UAAS,OAAO,EAAI,EAAA,CAAG,CAAA,CAAA,GAAK,EAAA,CAAG,CAAA,CAAA,EAAE;AAAG,WAAI,CAAA,EAAI,CAAA,UAAS,CAAE,CAAA,CAAC;AAAG,UAAA,EAAI,CAAA,CAAC,CAAA,EAAI,EAAA,CAAA,CAAI,CAAA,CAAA,AAAC,CAAC,CAAA,CAAC,CAAA,CAAI,CAAA,CAAA,EAAI,EAAA,CAAA,CAAI,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAG,EAAA,CAAC,CAAA,CAAI,CAAA,CAAA,AAAC,CAAC,MAAK,CAAG,IAAE,CAAC,CAAC,GAAK,EAAA,CAAC;AAAA,AACjJ,SAAO,CAAA,CAAA,EAAI,EAAA,CAAA,EAAK,EAAA,CAAA,EAAK,CAAA,MAAK,eAAe,AAAC,CAAC,MAAK,CAAG,IAAE,CAAG,EAAA,CAAC,CAAG,EAAA,CAAC;EACjE,CAAC;AACD,AAAI,IAAA,CAAA,UAAS,EAAI,CAAA,CAAC,IAAG,GAAK,CAAA,IAAG,WAAW,CAAC,GAAK,UAAU,CAAA,CAAG,CAAA,CAAA,CAAG;AAC1D,OAAI,MAAO,QAAM,CAAA,GAAM,SAAO,CAAA,EAAK,CAAA,MAAO,QAAM,SAAS,CAAA,GAAM,WAAS;AAAG,WAAO,CAAA,OAAM,SAAS,AAAC,CAAC,CAAA,CAAG,EAAA,CAAC,CAAC;AAAA,EAC5G,CAAC;AACD,AAAI,IAAA,CAAA,IAAG,EAAI,CAAA,OAAM,AAAC,CAAC,sBAAqB,CAAC,CAAC;AAC1C,AAAI,IAAA,CAAA,OAAM,EAAI,CAAA,OAAM,AAAC,CAAC,2BAA0B,CAAC,CAAC;AAIlD,AAAI,IAAA,CAAA,WAAU,EAAI,CAAA,CAAC,SAAS,AAAC,CAAE;AAC3B,WAAS,YAAU,CAAC,AAAC,CAAE;AACnB,SAAG,WAAW,EAAI,GAAC,CAAC;AAEpB,SAAG,MAAM,EAAI,GAAC,CAAC;AAEf,SAAG,OAAO,EAAI,GAAC,CAAC;AAEhB,SAAG,SAAS,EAAI,IAAI,CAAA,OAAM,aAAa,AAAC,EAAC,CAAC;AAE1C,SAAG,UAAU,EAAI,GAAC,CAAC;AAEnB,SAAG,iBAAiB,EAAI,KAAG,CAAC;IAChC;AAAA,AACA,cAAU,UAAU,eAAe,EAAI,UAAU,GAAE,CAAG;AAAE,SAAG,MAAM,EAAI,IAAE,CAAC;IAAE,CAAC;AAC3E,cAAU,UAAU,YAAY,EAAI,UAAU,GAAE,CAAG;AAAE,SAAG,UAAU,EAAI,IAAE,CAAC;IAAE,CAAC;AAC5E,cAAU,UAAU,KAAK,EAAI,UAAS,AAAC,CAAE;AAAE,WAAO,CAAA,IAAG,MAAM,CAAC;IAAE,CAAC;AAC/D,cAAU,UAAU,eAAe,EAAI,UAAU,QAAO,CAAG;AACvD,YAAM,kBAAkB,SAAS,AAAC,CAAC,IAAG,SAAS,CAAG;AAAE,YAAI,CAAG,SAAO;AAAG,YAAI,CAAG,KAAG;AAAA,MAAE,CAAC,CAAC;IACvF,CAAC;AACD,cAAU,UAAU,mBAAmB,EAAI,UAAU,QAAO,CAAG;AAE3D,SAAG,eAAe,AAAC,CAAC,QAAO,CAAC,CAAC;AAC7B,SAAG,WAAW,KAAK,AAAC,CAAC,QAAO,EAAI,SAAO,CAAC,CAAC;AACzC,YAAM,kBAAkB,SAAS,AAAC,CAAC,IAAG,SAAS,CAAG;AAAE,YAAI,CAAG,SAAO;AAAG,YAAI,CAAG,KAAG;AAAG,aAAK,CAAG,aAAW;AAAA,MAAE,CAAC,CAAC;IAC7G,CAAC;AACD,cAAU,UAAU,mBAAmB,EAAI,UAAU,GAAE,CAAG;AACtD,SAAI,GAAE,OAAO,EAAI,EAAA,CAAA,EAAK,EAAC,GAAE,WAAW,AAAC,CAAC,GAAE,CAAC,CAAG;AACxC,UAAE,EAAI,CAAA,GAAE,EAAI,IAAE,CAAC;MACnB;AAAA,AACA,WAAO,CAAA,IAAG,UAAU,EAAI,IAAE,CAAC;IAC/B,CAAC;AACD,cAAU,UAAU,GAAG,EAAI,UAAU,IAAG,CAAG,CAAA,KAAI,CAAG;AAC9C,SAAI,KAAI,IAAM,KAAK,EAAA,CAAG;AAAE,YAAI,EAAI,GAAC,CAAC;MAAE;AAAA,AACpC,SAAG,EAAI,CAAA,IAAG,mBAAmB,AAAC,CAAC,IAAG,CAAC,CAAC;AACpC,SAAI,IAAG,MAAM,GAAK,KAAG,CAAA,EAAK,CAAA,IAAG,OAAO,GAAK,MAAI,CAAG;AAC5C,eAAM;MACV;AAAA,AACA,SAAG,MAAM,EAAI,KAAG,CAAC;AACjB,SAAG,OAAO,EAAI,MAAI,CAAC;AACnB,AAAI,QAAA,CAAA,GAAE,EAAI,CAAA,IAAG,EAAI,EAAC,KAAI,OAAO,EAAI,EAAA,CAAA,CAAI,EAAC,GAAE,EAAI,MAAI,CAAC,EAAI,GAAC,CAAC,CAAC;AACxD,SAAG,WAAW,KAAK,AAAC,CAAC,GAAE,CAAC,CAAC;IAC7B,CAAC;AACD,cAAU,UAAU,aAAa,EAAI,UAAU,IAAG,CAAG,CAAA,KAAI,CAAG;AACxD,SAAI,KAAI,IAAM,KAAK,EAAA,CAAG;AAAE,YAAI,EAAI,GAAC,CAAC;MAAE;AAAA,AACpC,SAAG,EAAI,CAAA,IAALine truncated
|
||||
File renamed without changes.
File renamed without changes.
-1
@@ -1,4 +1,3 @@
|
||||
/* */
|
||||
"format register";
|
||||
System.register("angular2/src/upgrade/metadata", ["angular2/core"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
+774
@@ -0,0 +1,774 @@
|
||||
"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_PROTO_VIEW_REF_MAP = 'ng2.ProtoViewRefMap';
|
||||
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, protoView) {
|
||||
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.protoView = protoView;
|
||||
this.component = null;
|
||||
this.inputChangeCount = 0;
|
||||
this.inputChanges = null;
|
||||
this.hostViewRef = null;
|
||||
this.changeDetector = null;
|
||||
this.contentInserctionPoint = 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.hostViewRef = this.viewManager.createRootHostView(this.protoView, '#' + this.id, childInjector);
|
||||
var renderer = this.hostViewRef.render;
|
||||
var hostElement = this.viewManager.getHostElement(this.hostViewRef);
|
||||
this.changeDetector = this.hostViewRef.changeDetectorRef;
|
||||
this.component = this.viewManager.getComponent(hostElement);
|
||||
this.contentInserctionPoint = renderer.rootContentInsertionPoints[0];
|
||||
};
|
||||
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;
|
||||
if (this.contentInserctionPoint) {
|
||||
var parent = this.contentInserctionPoint.parentNode;
|
||||
for (var i = 0,
|
||||
ii = childNodes.length; i < ii; i++) {
|
||||
parent.insertBefore(childNodes[i], this.contentInserctionPoint);
|
||||
}
|
||||
}
|
||||
};
|
||||
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 scope = this.directive.scope;
|
||||
if (typeof scope == 'object') {
|
||||
for (var name in scope) {
|
||||
if (scope.hasOwnProperty(name)) {
|
||||
var localName = scope[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(scope);
|
||||
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 protoViewRefMap = {};
|
||||
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_PROTO_VIEW_REF_MAP, protoViewRefMap).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, protoViewRefMap), 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, protoViewRefMap) {
|
||||
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(protoViews) {
|
||||
var types = _this.upgradedComponents;
|
||||
for (var i = 0; i < protoViews.length; i++) {
|
||||
protoViewRefMap[metadata_1.getComponentInfo(types[i]).selector] = protoViews[i];
|
||||
}
|
||||
return protoViewRefMap;
|
||||
}, util_1.onError);
|
||||
};
|
||||
return UpgradeAdapter;
|
||||
})();
|
||||
exports.UpgradeAdapter = UpgradeAdapter;
|
||||
function ng1ComponentDirective(info, idPrefix) {
|
||||
directiveFactory.$inject = [constants_1.NG2_PROTO_VIEW_REF_MAP, constants_1.NG2_APP_VIEW_MANAGER, constants_1.NG1_PARSE];
|
||||
function directiveFactory(protoViewRefMap, viewManager, parse) {
|
||||
var protoView = protoViewRefMap[info.selector];
|
||||
if (!protoView)
|
||||
throw new Error('Expecting ProtoViewRef 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, protoView);
|
||||
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
|
||||
-1
@@ -1,2 +1 @@
|
||||
/* */
|
||||
"format register";System.register("angular2/src/upgrade/metadata",["angular2/core"],!0,function(t,e,r){function n(t){var e=c.resolve(t),r=e.selector;if(!r.match(p))throw new Error("Only selectors matching element names are supported, got: "+r);var r=r.replace(u,function(t,e){return e.toUpperCase()});return{type:t,selector:r,inputs:o(e.inputs),outputs:o(e.outputs)}}function o(t){var e=[];if(t)for(var r=0;r<t.length;r++){var n=t[r].split(":"),o=n[0].trim(),i=(n[1]||n[0]).trim(),a=i.charAt(0).toUpperCase()+i.substr(1);e.push({prop:o,attr:i,bracketAttr:"["+i+"]",parenAttr:"("+i+")",bracketParenAttr:"[("+i+")]",onAttr:"on"+a,bindAttr:"bind"+a,bindonAttr:"bindon"+a})}return e}var i=System.global,a=i.define;i.define=void 0;var s=t("angular2/core"),p=/^[\w|-]*$/,u=/-(\w)/g,c=new s.DirectiveResolver;return e.getComponentInfo=n,e.parseFields=o,i.define=a,r.exports}),System.register("angular2/src/upgrade/util",[],!0,function(t,e,r){function n(t){return"function"==typeof t?t.name||t.toString():""+t}function o(t){throw console.log(t,t.stack),t}function i(t){return"$"+t+"Controller"}var a=System.global,s=a.define;return a.define=void 0,e.stringify=n,e.onError=o,e.controllerKey=i,a.define=s,r.exports}),System.register("angular2/src/upgrade/constants",[],!0,function(t,e,r){var n=System.global,o=n.define;return n.define=void 0,e.NG2_APP_VIEW_MANAGER="ng2.AppViewManager",e.NG2_COMPILER="ng2.Compiler",e.NG2_INJECTOR="ng2.Injector",e.NG2_PROTO_VIEW_REF_MAP="ng2.ProtoViewRefMap",e.NG2_ZONE="ng2.NgZone",e.NG1_CONTROLLER="$controller",e.NG1_SCOPE="$scope",e.NG1_ROOT_SCOPE="$rootScope",e.NG1_COMPILE="$compile",e.NG1_HTTP_BACKEND="$httpBackend",e.NG1_INJECTOR="$injector",e.NG1_PARSE="$parse",e.NG1_TEMPLATE_CACHE="$templateCache",e.REQUIRE_INJECTOR="^"+e.NG2_INJECTOR,n.define=o,r.exports}),System.register("angular2/src/upgrade/downgrade_ng2_adapter",["angular2/core","angular2/src/upgrade/constants"],!0,function(t,e,r){var n=System.global,o=n.define;n.define=void 0;var i=t("angular2/core"),a=t("angular2/src/upgrade/constants"),s={__UNINITIALIZED__:!0},p=function(){function t(t,e,r,n,o,i,a,s,p){this.id=t,this.info=e,this.element=r,this.attrs=n,this.scope=o,this.parentInjector=i,this.parse=a,this.viewManager=s,this.protoView=p,this.component=null,this.inputChangeCount=0,this.inputChanges=null,this.hostViewRef=null,this.changeDetector=null,this.contentInserctionPoint=null,this.element[0].id=t,this.componentScope=o.$new(),this.childNodes=r.contents()}return t.prototype.bootstrapNg2=function(){var t=this.parentInjector.resolveAndCreateChild([i.provide(a.NG1_SCOPE,{useValue:this.componentScope})]);this.hostViewRef=this.viewManager.createRootHostView(this.protoView,"#"+this.id,t);var e=this.hostViewRef.render,r=this.viewManager.getHostElement(this.hostViewRef);this.changeDetector=this.hostViewRef.changeDetectorRef,this.component=this.viewManager.getComponent(r),this.contentInserctionPoint=e.rootContentInsertionPoints[0]},t.prototype.setupInputs=function(){for(var t=this,e=this.attrs,r=this.info.inputs,n=0;n<r.length;n++){var o=r[n],i=null;if(e.hasOwnProperty(o.attr)){var a=function(e){var r=s;return function(n){null!==t.inputChanges&&(t.inputChangeCount++,t.inputChanges[e]=new u(n,r===s?n:r),r=n),t.component[e]=n}}(o.prop);e.$observe(o.attr,a)}else e.hasOwnProperty(o.bindAttr)?i=e[o.bindAttr]:e.hasOwnProperty(o.bracketAttr)?i=e[o.bracketAttr]:e.hasOwnProperty(o.bindonAttr)?i=e[o.bindonAttr]:e.hasOwnProperty(o.bracketParenAttr)&&(i=e[o.bracketParenAttr]);if(null!=i){var p=function(e){return function(r,n){null!=t.inputChanges&&(t.inputChangeCount++,t.inputChanges[e]=new u(n,r)),t.component[e]=r}}(o.prop);this.componentScope.$watch(i,p)}}var c=this.info.type.prototype;c&&c.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return t.inputChangeCount},function(){var e=t.inputChanges;t.inputChanges={},t.component.ngOnChanges(e)})),this.componentScope.$watch(function(){return t.changeDetector&&t.changeDetector.detectChanges()})},t.prototype.projectContent=function(){var t=this.childNodes;if(this.contentInserctionPoint)for(var e=this.contentInserctionPoint.parentNode,r=0,n=t.length;n>r;r++)e.insertBefore(t[r],this.contentInserctionPoint)},t.prototype.setupOutputs=function(){for(var t=this,e=this.attrs,r=this.info.outputs,n=0;n<r.length;n++){var o=r[n],i=null,a=!1,s=o.bindonAttr?o.bindonAttr.substring(0,o.bindonAttr.length-6):null,p=o.bracketParenAttr?"[("+o.bracketParenAttr.substring(2,o.bracketParenAttr.length-8)+")]":null;if(e.hasOwnProperty(o.onAttr)?i=e[o.onAttr]:e.hasOwnProperty(o.parenAttr)?i=e[o.parenAttr]:e.hasOwnProperty(s)?(i=e[s],a=!0):e.hasOwnProperty(p)&&(i=e[p],a=!0),null!=i&&null!=a){var u=this.parse(i),c=u.assign;if(a&&!c)throw new Error("Expression '"+i+"' is not assignable!");var l=this.component[o.prop];if(!l)throw new Error("Missing emitter '"+o.prop+"' on component '"+this.info.selector+"'!");l.subscribe({next:a?function(e){return function(r){return e(t.scope,r)}}(c):function(e){return function(r){return
Line truncated
|
||||
+63
-20
@@ -1,4 +1,3 @@
|
||||
/* */
|
||||
"format register";
|
||||
System.register("angular2/src/facade/lang", [], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
@@ -34,19 +33,19 @@ System.register("angular2/src/facade/lang", [], true, function(require, exports,
|
||||
exports.getTypeNameForDebugging = getTypeNameForDebugging;
|
||||
exports.Math = _global.Math;
|
||||
exports.Date = _global.Date;
|
||||
var _devMode = !!_global.angularDevMode;
|
||||
var _devModeLocked = false;
|
||||
function lockDevMode() {
|
||||
_devModeLocked = true;
|
||||
var _devMode = true;
|
||||
var _modeLocked = false;
|
||||
function lockMode() {
|
||||
_modeLocked = true;
|
||||
}
|
||||
exports.lockDevMode = lockDevMode;
|
||||
function enableDevMode() {
|
||||
if (_devModeLocked) {
|
||||
throw 'Cannot enable dev mode after platform setup.';
|
||||
exports.lockMode = lockMode;
|
||||
function enableProdMode() {
|
||||
if (_modeLocked) {
|
||||
throw 'Cannot enable prod mode after platform setup.';
|
||||
}
|
||||
_devMode = true;
|
||||
_devMode = false;
|
||||
}
|
||||
exports.enableDevMode = enableDevMode;
|
||||
exports.enableProdMode = enableProdMode;
|
||||
function assertionsEnabled() {
|
||||
return _devMode;
|
||||
}
|
||||
@@ -6972,6 +6971,41 @@ System.register("angular2/src/core/linker/template_commands", ["angular2/src/fac
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/console", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
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 di_1 = require("angular2/src/core/di");
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
var Console = (function() {
|
||||
function Console() {}
|
||||
Console.prototype.log = function(message) {
|
||||
lang_1.print(message);
|
||||
};
|
||||
Console = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], Console);
|
||||
return Console;
|
||||
})();
|
||||
exports.Console = Console;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/zone", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
@@ -7009,12 +7043,12 @@ System.register("angular2/src/core/util", ["angular2/src/core/util/decorators"],
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/dev_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/prod_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
exports.enableDevMode = lang_1.enableDevMode;
|
||||
exports.enableProdMode = lang_1.enableProdMode;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
@@ -7289,12 +7323,13 @@ System.register("angular2/src/core/debug/debug_element", ["angular2/src/facade/l
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/platform_common_providers", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/platform_common_providers", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/console", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
var di_1 = require("angular2/src/core/di");
|
||||
var console_1 = require("angular2/src/core/console");
|
||||
var reflection_1 = require("angular2/src/core/reflection/reflection");
|
||||
var testability_1 = require("angular2/src/core/testability/testability");
|
||||
function _reflector() {
|
||||
@@ -7303,7 +7338,7 @@ System.register("angular2/src/core/platform_common_providers", ["angular2/src/fa
|
||||
exports.PLATFORM_COMMON_PROVIDERS = lang_1.CONST_EXPR([new di_1.Provider(reflection_1.Reflector, {
|
||||
useFactory: _reflector,
|
||||
deps: []
|
||||
}), testability_1.TestabilityRegistry]);
|
||||
}), testability_1.TestabilityRegistry, console_1.Console]);
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
@@ -13409,7 +13444,7 @@ System.register("angular2/src/core/metadata", ["angular2/src/core/metadata/di",
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/dev_mode", "angular2/src/core/di", "angular2/src/facade/facade", "angular2/src/core/application_ref", "angular2/src/core/application_tokens", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/debug/debug_element", "angular2/src/core/testability/testability", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/platform_common_providers", "angular2/src/core/application_common_providers", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) {
|
||||
System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/prod_mode", "angular2/src/core/di", "angular2/src/facade/facade", "angular2/src/facade/lang", "angular2/src/core/application_ref", "angular2/src/core/application_tokens", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/debug/debug_element", "angular2/src/core/testability/testability", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/platform_common_providers", "angular2/src/core/application_common_providers", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
@@ -13420,9 +13455,11 @@ System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/co
|
||||
}
|
||||
__export(require("angular2/src/core/metadata"));
|
||||
__export(require("angular2/src/core/util"));
|
||||
__export(require("angular2/src/core/dev_mode"));
|
||||
__export(require("angular2/src/core/prod_mode"));
|
||||
__export(require("angular2/src/core/di"));
|
||||
__export(require("angular2/src/facade/facade"));
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
exports.enableProdMode = lang_1.enableProdMode;
|
||||
var application_ref_1 = require("angular2/src/core/application_ref");
|
||||
exports.platform = application_ref_1.platform;
|
||||
exports.createNgZone = application_ref_1.createNgZone;
|
||||
@@ -23442,7 +23479,7 @@ System.register("angular2/src/platform/worker_render_common", ["angular2/src/fac
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/profile/profile", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/console", "angular2/src/core/profile/profile", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
@@ -23465,6 +23502,7 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader");
|
||||
var exceptions_1 = require("angular2/src/facade/exceptions");
|
||||
var view_ref_1 = require("angular2/src/core/linker/view_ref");
|
||||
var console_1 = require("angular2/src/core/console");
|
||||
var profile_1 = require("angular2/src/core/profile/profile");
|
||||
var lang_2 = require("angular2/src/facade/lang");
|
||||
function _componentProviders(appComponentType) {
|
||||
@@ -23498,7 +23536,7 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
var _platform;
|
||||
var _platformProviders;
|
||||
function platform(providers) {
|
||||
lang_2.lockDevMode();
|
||||
lang_2.lockMode();
|
||||
if (lang_1.isPresent(_platform)) {
|
||||
if (collection_1.ListWrapper.equals(_platformProviders, providers)) {
|
||||
return _platform;
|
||||
@@ -23731,7 +23769,12 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
completer.reject(e, e.stack);
|
||||
}
|
||||
});
|
||||
return completer.promise;
|
||||
return completer.promise.then(function(_) {
|
||||
var c = _this._injector.get(console_1.Console);
|
||||
var modeDescription = lang_1.assertionsEnabled() ? "in the development mode. Call enableProdMode() to enable the production mode." : "in the production mode. Call enableDevMode() to enable the development mode.";
|
||||
c.log("Angular 2 is running " + modeDescription);
|
||||
return _;
|
||||
});
|
||||
};
|
||||
ApplicationRef_.prototype._loadComponent = function(ref) {
|
||||
var appChangeDetector = view_ref_1.internalView(ref.hostView).changeDetector;
|
||||
+63
-20
@@ -1,4 +1,3 @@
|
||||
/* */
|
||||
"format register";
|
||||
System.register("angular2/src/facade/lang", [], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
@@ -34,19 +33,19 @@ System.register("angular2/src/facade/lang", [], true, function(require, exports,
|
||||
exports.getTypeNameForDebugging = getTypeNameForDebugging;
|
||||
exports.Math = _global.Math;
|
||||
exports.Date = _global.Date;
|
||||
var _devMode = !!_global.angularDevMode;
|
||||
var _devModeLocked = false;
|
||||
function lockDevMode() {
|
||||
_devModeLocked = true;
|
||||
var _devMode = true;
|
||||
var _modeLocked = false;
|
||||
function lockMode() {
|
||||
_modeLocked = true;
|
||||
}
|
||||
exports.lockDevMode = lockDevMode;
|
||||
function enableDevMode() {
|
||||
if (_devModeLocked) {
|
||||
throw 'Cannot enable dev mode after platform setup.';
|
||||
exports.lockMode = lockMode;
|
||||
function enableProdMode() {
|
||||
if (_modeLocked) {
|
||||
throw 'Cannot enable prod mode after platform setup.';
|
||||
}
|
||||
_devMode = true;
|
||||
_devMode = false;
|
||||
}
|
||||
exports.enableDevMode = enableDevMode;
|
||||
exports.enableProdMode = enableProdMode;
|
||||
function assertionsEnabled() {
|
||||
return _devMode;
|
||||
}
|
||||
@@ -5552,12 +5551,12 @@ System.register("angular2/src/core/util", ["angular2/src/core/util/decorators"],
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/dev_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/prod_mode", ["angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
exports.enableDevMode = lang_1.enableDevMode;
|
||||
exports.enableProdMode = lang_1.enableProdMode;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
@@ -7332,6 +7331,41 @@ System.register("angular2/src/core/linker/template_commands", ["angular2/src/fac
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/console", ["angular2/src/core/di", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
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 di_1 = require("angular2/src/core/di");
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
var Console = (function() {
|
||||
function Console() {}
|
||||
Console.prototype.log = function(message) {
|
||||
lang_1.print(message);
|
||||
};
|
||||
Console = __decorate([di_1.Injectable(), __metadata('design:paramtypes', [])], Console);
|
||||
return Console;
|
||||
})();
|
||||
exports.Console = Console;
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/zone", ["angular2/src/core/zone/ng_zone"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
@@ -7613,12 +7647,13 @@ System.register("angular2/src/core/debug/debug_element", ["angular2/src/facade/l
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/platform_common_providers", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/platform_common_providers", ["angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/console", "angular2/src/core/reflection/reflection", "angular2/src/core/testability/testability"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
var di_1 = require("angular2/src/core/di");
|
||||
var console_1 = require("angular2/src/core/console");
|
||||
var reflection_1 = require("angular2/src/core/reflection/reflection");
|
||||
var testability_1 = require("angular2/src/core/testability/testability");
|
||||
function _reflector() {
|
||||
@@ -7627,7 +7662,7 @@ System.register("angular2/src/core/platform_common_providers", ["angular2/src/fa
|
||||
exports.PLATFORM_COMMON_PROVIDERS = lang_1.CONST_EXPR([new di_1.Provider(reflection_1.Reflector, {
|
||||
useFactory: _reflector,
|
||||
deps: []
|
||||
}), testability_1.TestabilityRegistry]);
|
||||
}), testability_1.TestabilityRegistry, console_1.Console]);
|
||||
global.define = __define;
|
||||
return module.exports;
|
||||
});
|
||||
@@ -35820,7 +35855,7 @@ System.register("angular2/src/core/metadata/directives", ["angular2/src/facade/l
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/profile/profile", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng_zone", "angular2/src/facade/lang", "angular2/src/core/di", "angular2/src/core/application_tokens", "angular2/src/facade/async", "angular2/src/facade/collection", "angular2/src/core/testability/testability", "angular2/src/core/linker/dynamic_component_loader", "angular2/src/facade/exceptions", "angular2/src/core/linker/view_ref", "angular2/src/core/console", "angular2/src/core/profile/profile", "angular2/src/facade/lang"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
@@ -35843,6 +35878,7 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
var dynamic_component_loader_1 = require("angular2/src/core/linker/dynamic_component_loader");
|
||||
var exceptions_1 = require("angular2/src/facade/exceptions");
|
||||
var view_ref_1 = require("angular2/src/core/linker/view_ref");
|
||||
var console_1 = require("angular2/src/core/console");
|
||||
var profile_1 = require("angular2/src/core/profile/profile");
|
||||
var lang_2 = require("angular2/src/facade/lang");
|
||||
function _componentProviders(appComponentType) {
|
||||
@@ -35876,7 +35912,7 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
var _platform;
|
||||
var _platformProviders;
|
||||
function platform(providers) {
|
||||
lang_2.lockDevMode();
|
||||
lang_2.lockMode();
|
||||
if (lang_1.isPresent(_platform)) {
|
||||
if (collection_1.ListWrapper.equals(_platformProviders, providers)) {
|
||||
return _platform;
|
||||
@@ -36109,7 +36145,12 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
|
||||
completer.reject(e, e.stack);
|
||||
}
|
||||
});
|
||||
return completer.promise;
|
||||
return completer.promise.then(function(_) {
|
||||
var c = _this._injector.get(console_1.Console);
|
||||
var modeDescription = lang_1.assertionsEnabled() ? "in the development mode. Call enableProdMode() to enable the production mode." : "in the production mode. Call enableDevMode() to enable the development mode.";
|
||||
c.log("Angular 2 is running " + modeDescription);
|
||||
return _;
|
||||
});
|
||||
};
|
||||
ApplicationRef_.prototype._loadComponent = function(ref) {
|
||||
var appChangeDetector = view_ref_1.internalView(ref.hostView).changeDetector;
|
||||
@@ -36349,7 +36390,7 @@ System.register("angular2/platform/worker_app", ["angular2/src/platform/worker_a
|
||||
return module.exports;
|
||||
});
|
||||
|
||||
System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/dev_mode", "angular2/src/core/di", "angular2/src/facade/facade", "angular2/src/core/application_ref", "angular2/src/core/application_tokens", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/debug/debug_element", "angular2/src/core/testability/testability", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/platform_common_providers", "angular2/src/core/application_common_providers", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) {
|
||||
System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/core/util", "angular2/src/core/prod_mode", "angular2/src/core/di", "angular2/src/facade/facade", "angular2/src/facade/lang", "angular2/src/core/application_ref", "angular2/src/core/application_tokens", "angular2/src/core/zone", "angular2/src/core/render", "angular2/src/core/linker", "angular2/src/core/debug/debug_element", "angular2/src/core/testability/testability", "angular2/src/core/change_detection", "angular2/src/core/platform_directives_and_pipes", "angular2/src/core/platform_common_providers", "angular2/src/core/application_common_providers", "angular2/src/core/reflection/reflection"], true, function(require, exports, module) {
|
||||
var global = System.global,
|
||||
__define = global.define;
|
||||
global.define = undefined;
|
||||
@@ -36360,9 +36401,11 @@ System.register("angular2/core", ["angular2/src/core/metadata", "angular2/src/co
|
||||
}
|
||||
__export(require("angular2/src/core/metadata"));
|
||||
__export(require("angular2/src/core/util"));
|
||||
__export(require("angular2/src/core/dev_mode"));
|
||||
__export(require("angular2/src/core/prod_mode"));
|
||||
__export(require("angular2/src/core/di"));
|
||||
__export(require("angular2/src/facade/facade"));
|
||||
var lang_1 = require("angular2/src/facade/lang");
|
||||
exports.enableProdMode = lang_1.enableProdMode;
|
||||
var application_ref_1 = require("angular2/src/core/application_ref");
|
||||
exports.platform = application_ref_1.platform;
|
||||
exports.createNgZone = application_ref_1.createNgZone;
|
||||
Vendored
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
+967
@@ -0,0 +1,967 @@
|
||||
/*!
|
||||
* @overview es6-promise - a tiny implementation of Promises/A+.
|
||||
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
||||
* @license Licensed under MIT license
|
||||
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
|
||||
* @version 3.0.2
|
||||
*/
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
function lib$es6$promise$utils$$objectOrFunction(x) {
|
||||
return typeof x === 'function' || (typeof x === 'object' && x !== null);
|
||||
}
|
||||
|
||||
function lib$es6$promise$utils$$isFunction(x) {
|
||||
return typeof x === 'function';
|
||||
}
|
||||
|
||||
function lib$es6$promise$utils$$isMaybeThenable(x) {
|
||||
return typeof x === 'object' && x !== null;
|
||||
}
|
||||
|
||||
var lib$es6$promise$utils$$_isArray;
|
||||
if (!Array.isArray) {
|
||||
lib$es6$promise$utils$$_isArray = function (x) {
|
||||
return Object.prototype.toString.call(x) === '[object Array]';
|
||||
};
|
||||
} else {
|
||||
lib$es6$promise$utils$$_isArray = Array.isArray;
|
||||
}
|
||||
|
||||
var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray;
|
||||
var lib$es6$promise$asap$$len = 0;
|
||||
var lib$es6$promise$asap$$toString = {}.toString;
|
||||
var lib$es6$promise$asap$$vertxNext;
|
||||
var lib$es6$promise$asap$$customSchedulerFn;
|
||||
|
||||
var lib$es6$promise$asap$$asap = function asap(callback, arg) {
|
||||
lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len] = callback;
|
||||
lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len + 1] = arg;
|
||||
lib$es6$promise$asap$$len += 2;
|
||||
if (lib$es6$promise$asap$$len === 2) {
|
||||
// If len is 2, that means that we need to schedule an async flush.
|
||||
// If additional callbacks are queued before the queue is flushed, they
|
||||
// will be processed by this flush that we are scheduling.
|
||||
if (lib$es6$promise$asap$$customSchedulerFn) {
|
||||
lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);
|
||||
} else {
|
||||
lib$es6$promise$asap$$scheduleFlush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function lib$es6$promise$asap$$setScheduler(scheduleFn) {
|
||||
lib$es6$promise$asap$$customSchedulerFn = scheduleFn;
|
||||
}
|
||||
|
||||
function lib$es6$promise$asap$$setAsap(asapFn) {
|
||||
lib$es6$promise$asap$$asap = asapFn;
|
||||
}
|
||||
|
||||
var lib$es6$promise$asap$$browserWindow = (typeof window !== 'undefined') ? window : undefined;
|
||||
var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {};
|
||||
var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;
|
||||
var lib$es6$promise$asap$$isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
|
||||
|
||||
// test for web worker but not in IE10
|
||||
var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' &&
|
||||
typeof importScripts !== 'undefined' &&
|
||||
typeof MessageChannel !== 'undefined';
|
||||
|
||||
// node
|
||||
function lib$es6$promise$asap$$useNextTick() {
|
||||
// node version 0.10.x displays a deprecation warning when nextTick is used recursively
|
||||
// see https://github.com/cujojs/when/issues/410 for details
|
||||
return function() {
|
||||
process.nextTick(lib$es6$promise$asap$$flush);
|
||||
};
|
||||
}
|
||||
|
||||
// vertx
|
||||
function lib$es6$promise$asap$$useVertxTimer() {
|
||||
return function() {
|
||||
lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);
|
||||
};
|
||||
}
|
||||
|
||||
function lib$es6$promise$asap$$useMutationObserver() {
|
||||
var iterations = 0;
|
||||
var observer = new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);
|
||||
var node = document.createTextNode('');
|
||||
observer.observe(node, { characterData: true });
|
||||
|
||||
return function() {
|
||||
node.data = (iterations = ++iterations % 2);
|
||||
};
|
||||
}
|
||||
|
||||
// web worker
|
||||
function lib$es6$promise$asap$$useMessageChannel() {
|
||||
var channel = new MessageChannel();
|
||||
channel.port1.onmessage = lib$es6$promise$asap$$flush;
|
||||
return function () {
|
||||
channel.port2.postMessage(0);
|
||||
};
|
||||
}
|
||||
|
||||
function lib$es6$promise$asap$$useSetTimeout() {
|
||||
return function() {
|
||||
setTimeout(lib$es6$promise$asap$$flush, 1);
|
||||
};
|
||||
}
|
||||
|
||||
var lib$es6$promise$asap$$queue = new Array(1000);
|
||||
function lib$es6$promise$asap$$flush() {
|
||||
for (var i = 0; i < lib$es6$promise$asap$$len; i+=2) {
|
||||
var callback = lib$es6$promise$asap$$queue[i];
|
||||
var arg = lib$es6$promise$asap$$queue[i+1];
|
||||
|
||||
callback(arg);
|
||||
|
||||
lib$es6$promise$asap$$queue[i] = undefined;
|
||||
lib$es6$promise$asap$$queue[i+1] = undefined;
|
||||
}
|
||||
|
||||
lib$es6$promise$asap$$len = 0;
|
||||
}
|
||||
|
||||
function lib$es6$promise$asap$$attemptVertx() {
|
||||
try {
|
||||
var r = require;
|
||||
var vertx = r('vertx');
|
||||
lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext;
|
||||
return lib$es6$promise$asap$$useVertxTimer();
|
||||
} catch(e) {
|
||||
return lib$es6$promise$asap$$useSetTimeout();
|
||||
}
|
||||
}
|
||||
|
||||
var lib$es6$promise$asap$$scheduleFlush;
|
||||
// Decide what async method to use to triggering processing of queued callbacks:
|
||||
if (lib$es6$promise$asap$$isNode) {
|
||||
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useNextTick();
|
||||
} else if (lib$es6$promise$asap$$BrowserMutationObserver) {
|
||||
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver();
|
||||
} else if (lib$es6$promise$asap$$isWorker) {
|
||||
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel();
|
||||
} else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') {
|
||||
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx();
|
||||
} else {
|
||||
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout();
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$noop() {}
|
||||
|
||||
var lib$es6$promise$$internal$$PENDING = void 0;
|
||||
var lib$es6$promise$$internal$$FULFILLED = 1;
|
||||
var lib$es6$promise$$internal$$REJECTED = 2;
|
||||
|
||||
var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject();
|
||||
|
||||
function lib$es6$promise$$internal$$selfFulfillment() {
|
||||
return new TypeError("You cannot resolve a promise with itself");
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$cannotReturnOwn() {
|
||||
return new TypeError('A promises callback cannot return that same promise.');
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$getThen(promise) {
|
||||
try {
|
||||
return promise.then;
|
||||
} catch(error) {
|
||||
lib$es6$promise$$internal$$GET_THEN_ERROR.error = error;
|
||||
return lib$es6$promise$$internal$$GET_THEN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
|
||||
try {
|
||||
then.call(value, fulfillmentHandler, rejectionHandler);
|
||||
} catch(e) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {
|
||||
lib$es6$promise$asap$$asap(function(promise) {
|
||||
var sealed = false;
|
||||
var error = lib$es6$promise$$internal$$tryThen(then, thenable, function(value) {
|
||||
if (sealed) { return; }
|
||||
sealed = true;
|
||||
if (thenable !== value) {
|
||||
lib$es6$promise$$internal$$resolve(promise, value);
|
||||
} else {
|
||||
lib$es6$promise$$internal$$fulfill(promise, value);
|
||||
}
|
||||
}, function(reason) {
|
||||
if (sealed) { return; }
|
||||
sealed = true;
|
||||
|
||||
lib$es6$promise$$internal$$reject(promise, reason);
|
||||
}, 'Settle: ' + (promise._label || ' unknown promise'));
|
||||
|
||||
if (!sealed && error) {
|
||||
sealed = true;
|
||||
lib$es6$promise$$internal$$reject(promise, error);
|
||||
}
|
||||
}, promise);
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {
|
||||
if (thenable._state === lib$es6$promise$$internal$$FULFILLED) {
|
||||
lib$es6$promise$$internal$$fulfill(promise, thenable._result);
|
||||
} else if (thenable._state === lib$es6$promise$$internal$$REJECTED) {
|
||||
lib$es6$promise$$internal$$reject(promise, thenable._result);
|
||||
} else {
|
||||
lib$es6$promise$$internal$$subscribe(thenable, undefined, function(value) {
|
||||
lib$es6$promise$$internal$$resolve(promise, value);
|
||||
}, function(reason) {
|
||||
lib$es6$promise$$internal$$reject(promise, reason);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable) {
|
||||
if (maybeThenable.constructor === promise.constructor) {
|
||||
lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);
|
||||
} else {
|
||||
var then = lib$es6$promise$$internal$$getThen(maybeThenable);
|
||||
|
||||
if (then === lib$es6$promise$$internal$$GET_THEN_ERROR) {
|
||||
lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);
|
||||
} else if (then === undefined) {
|
||||
lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
|
||||
} else if (lib$es6$promise$utils$$isFunction(then)) {
|
||||
lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);
|
||||
} else {
|
||||
lib$es6$promise$$internal$$fulfill(promise, maybeThenable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$resolve(promise, value) {
|
||||
if (promise === value) {
|
||||
lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment());
|
||||
} else if (lib$es6$promise$utils$$objectOrFunction(value)) {
|
||||
lib$es6$promise$$internal$$handleMaybeThenable(promise, value);
|
||||
} else {
|
||||
lib$es6$promise$$internal$$fulfill(promise, value);
|
||||
}
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$publishRejection(promise) {
|
||||
if (promise._onerror) {
|
||||
promise._onerror(promise._result);
|
||||
}
|
||||
|
||||
lib$es6$promise$$internal$$publish(promise);
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$fulfill(promise, value) {
|
||||
if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; }
|
||||
|
||||
promise._result = value;
|
||||
promise._state = lib$es6$promise$$internal$$FULFILLED;
|
||||
|
||||
if (promise._subscribers.length !== 0) {
|
||||
lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);
|
||||
}
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$reject(promise, reason) {
|
||||
if (promise._state !== lib$es6$promise$$internal$$PENDING) { return; }
|
||||
promise._state = lib$es6$promise$$internal$$REJECTED;
|
||||
promise._result = reason;
|
||||
|
||||
lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
|
||||
var subscribers = parent._subscribers;
|
||||
var length = subscribers.length;
|
||||
|
||||
parent._onerror = null;
|
||||
|
||||
subscribers[length] = child;
|
||||
subscribers[length + lib$es6$promise$$internal$$FULFILLED] = onFulfillment;
|
||||
subscribers[length + lib$es6$promise$$internal$$REJECTED] = onRejection;
|
||||
|
||||
if (length === 0 && parent._state) {
|
||||
lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);
|
||||
}
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$publish(promise) {
|
||||
var subscribers = promise._subscribers;
|
||||
var settled = promise._state;
|
||||
|
||||
if (subscribers.length === 0) { return; }
|
||||
|
||||
var child, callback, detail = promise._result;
|
||||
|
||||
for (var i = 0; i < subscribers.length; i += 3) {
|
||||
child = subscribers[i];
|
||||
callback = subscribers[i + settled];
|
||||
|
||||
if (child) {
|
||||
lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);
|
||||
} else {
|
||||
callback(detail);
|
||||
}
|
||||
}
|
||||
|
||||
promise._subscribers.length = 0;
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$ErrorObject() {
|
||||
this.error = null;
|
||||
}
|
||||
|
||||
var lib$es6$promise$$internal$$TRY_CATCH_ERROR = new lib$es6$promise$$internal$$ErrorObject();
|
||||
|
||||
function lib$es6$promise$$internal$$tryCatch(callback, detail) {
|
||||
try {
|
||||
return callback(detail);
|
||||
} catch(e) {
|
||||
lib$es6$promise$$internal$$TRY_CATCH_ERROR.error = e;
|
||||
return lib$es6$promise$$internal$$TRY_CATCH_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {
|
||||
var hasCallback = lib$es6$promise$utils$$isFunction(callback),
|
||||
value, error, succeeded, failed;
|
||||
|
||||
if (hasCallback) {
|
||||
value = lib$es6$promise$$internal$$tryCatch(callback, detail);
|
||||
|
||||
if (value === lib$es6$promise$$internal$$TRY_CATCH_ERROR) {
|
||||
failed = true;
|
||||
error = value.error;
|
||||
value = null;
|
||||
} else {
|
||||
succeeded = true;
|
||||
}
|
||||
|
||||
if (promise === value) {
|
||||
lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
value = detail;
|
||||
succeeded = true;
|
||||
}
|
||||
|
||||
if (promise._state !== lib$es6$promise$$internal$$PENDING) {
|
||||
// noop
|
||||
} else if (hasCallback && succeeded) {
|
||||
lib$es6$promise$$internal$$resolve(promise, value);
|
||||
} else if (failed) {
|
||||
lib$es6$promise$$internal$$reject(promise, error);
|
||||
} else if (settled === lib$es6$promise$$internal$$FULFILLED) {
|
||||
lib$es6$promise$$internal$$fulfill(promise, value);
|
||||
} else if (settled === lib$es6$promise$$internal$$REJECTED) {
|
||||
lib$es6$promise$$internal$$reject(promise, value);
|
||||
}
|
||||
}
|
||||
|
||||
function lib$es6$promise$$internal$$initializePromise(promise, resolver) {
|
||||
try {
|
||||
resolver(function resolvePromise(value){
|
||||
lib$es6$promise$$internal$$resolve(promise, value);
|
||||
}, function rejectPromise(reason) {
|
||||
lib$es6$promise$$internal$$reject(promise, reason);
|
||||
});
|
||||
} catch(e) {
|
||||
lib$es6$promise$$internal$$reject(promise, e);
|
||||
}
|
||||
}
|
||||
|
||||
function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {
|
||||
var enumerator = this;
|
||||
|
||||
enumerator._instanceConstructor = Constructor;
|
||||
enumerator.promise = new Constructor(lib$es6$promise$$internal$$noop);
|
||||
|
||||
if (enumerator._validateInput(input)) {
|
||||
enumerator._input = input;
|
||||
enumerator.length = input.length;
|
||||
enumerator._remaining = input.length;
|
||||
|
||||
enumerator._init();
|
||||
|
||||
if (enumerator.length === 0) {
|
||||
lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
|
||||
} else {
|
||||
enumerator.length = enumerator.length || 0;
|
||||
enumerator._enumerate();
|
||||
if (enumerator._remaining === 0) {
|
||||
lib$es6$promise$$internal$$fulfill(enumerator.promise, enumerator._result);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
lib$es6$promise$$internal$$reject(enumerator.promise, enumerator._validationError());
|
||||
}
|
||||
}
|
||||
|
||||
lib$es6$promise$enumerator$$Enumerator.prototype._validateInput = function(input) {
|
||||
return lib$es6$promise$utils$$isArray(input);
|
||||
};
|
||||
|
||||
lib$es6$promise$enumerator$$Enumerator.prototype._validationError = function() {
|
||||
return new Error('Array Methods must be provided an Array');
|
||||
};
|
||||
|
||||
lib$es6$promise$enumerator$$Enumerator.prototype._init = function() {
|
||||
this._result = new Array(this.length);
|
||||
};
|
||||
|
||||
var lib$es6$promise$enumerator$$default = lib$es6$promise$enumerator$$Enumerator;
|
||||
|
||||
lib$es6$promise$enumerator$$Enumerator.prototype._enumerate = function() {
|
||||
var enumerator = this;
|
||||
|
||||
var length = enumerator.length;
|
||||
var promise = enumerator.promise;
|
||||
var input = enumerator._input;
|
||||
|
||||
for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) {
|
||||
enumerator._eachEntry(input[i], i);
|
||||
}
|
||||
};
|
||||
|
||||
lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) {
|
||||
var enumerator = this;
|
||||
var c = enumerator._instanceConstructor;
|
||||
|
||||
if (lib$es6$promise$utils$$isMaybeThenable(entry)) {
|
||||
if (entry.constructor === c && entry._state !== lib$es6$promise$$internal$$PENDING) {
|
||||
entry._onerror = null;
|
||||
enumerator._settledAt(entry._state, i, entry._result);
|
||||
} else {
|
||||
enumerator._willSettleAt(c.resolve(entry), i);
|
||||
}
|
||||
} else {
|
||||
enumerator._remaining--;
|
||||
enumerator._result[i] = entry;
|
||||
}
|
||||
};
|
||||
|
||||
lib$es6$promise$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) {
|
||||
var enumerator = this;
|
||||
var promise = enumerator.promise;
|
||||
|
||||
if (promise._state === lib$es6$promise$$internal$$PENDING) {
|
||||
enumerator._remaining--;
|
||||
|
||||
if (state === lib$es6$promise$$internal$$REJECTED) {
|
||||
lib$es6$promise$$internal$$reject(promise, value);
|
||||
} else {
|
||||
enumerator._result[i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
if (enumerator._remaining === 0) {
|
||||
lib$es6$promise$$internal$$fulfill(promise, enumerator._result);
|
||||
}
|
||||
};
|
||||
|
||||
lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) {
|
||||
var enumerator = this;
|
||||
|
||||
lib$es6$promise$$internal$$subscribe(promise, undefined, function(value) {
|
||||
enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);
|
||||
}, function(reason) {
|
||||
enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);
|
||||
});
|
||||
};
|
||||
function lib$es6$promise$promise$all$$all(entries) {
|
||||
return new lib$es6$promise$enumerator$$default(this, entries).promise;
|
||||
}
|
||||
var lib$es6$promise$promise$all$$default = lib$es6$promise$promise$all$$all;
|
||||
function lib$es6$promise$promise$race$$race(entries) {
|
||||
/*jshint validthis:true */
|
||||
var Constructor = this;
|
||||
|
||||
var promise = new Constructor(lib$es6$promise$$internal$$noop);
|
||||
|
||||
if (!lib$es6$promise$utils$$isArray(entries)) {
|
||||
lib$es6$promise$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
|
||||
return promise;
|
||||
}
|
||||
|
||||
var length = entries.length;
|
||||
|
||||
function onFulfillment(value) {
|
||||
lib$es6$promise$$internal$$resolve(promise, value);
|
||||
}
|
||||
|
||||
function onRejection(reason) {
|
||||
lib$es6$promise$$internal$$reject(promise, reason);
|
||||
}
|
||||
|
||||
for (var i = 0; promise._state === lib$es6$promise$$internal$$PENDING && i < length; i++) {
|
||||
lib$es6$promise$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
|
||||
}
|
||||
|
||||
return promise;
|
||||
}
|
||||
var lib$es6$promise$promise$race$$default = lib$es6$promise$promise$race$$race;
|
||||
function lib$es6$promise$promise$resolve$$resolve(object) {
|
||||
/*jshint validthis:true */
|
||||
var Constructor = this;
|
||||
|
||||
if (object && typeof object === 'object' && object.constructor === Constructor) {
|
||||
return object;
|
||||
}
|
||||
|
||||
var promise = new Constructor(lib$es6$promise$$internal$$noop);
|
||||
lib$es6$promise$$internal$$resolve(promise, object);
|
||||
return promise;
|
||||
}
|
||||
var lib$es6$promise$promise$resolve$$default = lib$es6$promise$promise$resolve$$resolve;
|
||||
function lib$es6$promise$promise$reject$$reject(reason) {
|
||||
/*jshint validthis:true */
|
||||
var Constructor = this;
|
||||
var promise = new Constructor(lib$es6$promise$$internal$$noop);
|
||||
lib$es6$promise$$internal$$reject(promise, reason);
|
||||
return promise;
|
||||
}
|
||||
var lib$es6$promise$promise$reject$$default = lib$es6$promise$promise$reject$$reject;
|
||||
|
||||
var lib$es6$promise$promise$$counter = 0;
|
||||
|
||||
function lib$es6$promise$promise$$needsResolver() {
|
||||
throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
|
||||
}
|
||||
|
||||
function lib$es6$promise$promise$$needsNew() {
|
||||
throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
|
||||
}
|
||||
|
||||
var lib$es6$promise$promise$$default = lib$es6$promise$promise$$Promise;
|
||||
/**
|
||||
Promise objects represent the eventual result of an asynchronous operation. The
|
||||
primary way of interacting with a promise is through its `then` method, which
|
||||
registers callbacks to receive either a promise's eventual value or the reason
|
||||
why the promise cannot be fulfilled.
|
||||
|
||||
Terminology
|
||||
-----------
|
||||
|
||||
- `promise` is an object or function with a `then` method whose behavior conforms to this specification.
|
||||
- `thenable` is an object or function that defines a `then` method.
|
||||
- `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
|
||||
- `exception` is a value that is thrown using the throw statement.
|
||||
- `reason` is a value that indicates why a promise was rejected.
|
||||
- `settled` the final resting state of a promise, fulfilled or rejected.
|
||||
|
||||
A promise can be in one of three states: pending, fulfilled, or rejected.
|
||||
|
||||
Promises that are fulfilled have a fulfillment value and are in the fulfilled
|
||||
state. Promises that are rejected have a rejection reason and are in the
|
||||
rejected state. A fulfillment value is never a thenable.
|
||||
|
||||
Promises can also be said to *resolve* a value. If this value is also a
|
||||
promise, then the original promise's settled state will match the value's
|
||||
settled state. So a promise that *resolves* a promise that rejects will
|
||||
itself reject, and a promise that *resolves* a promise that fulfills will
|
||||
itself fulfill.
|
||||
|
||||
|
||||
Basic Usage:
|
||||
------------
|
||||
|
||||
```js
|
||||
var promise = new Promise(function(resolve, reject) {
|
||||
// on success
|
||||
resolve(value);
|
||||
|
||||
// on failure
|
||||
reject(reason);
|
||||
});
|
||||
|
||||
promise.then(function(value) {
|
||||
// on fulfillment
|
||||
}, function(reason) {
|
||||
// on rejection
|
||||
});
|
||||
```
|
||||
|
||||
Advanced Usage:
|
||||
---------------
|
||||
|
||||
Promises shine when abstracting away asynchronous interactions such as
|
||||
`XMLHttpRequest`s.
|
||||
|
||||
```js
|
||||
function getJSON(url) {
|
||||
return new Promise(function(resolve, reject){
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
xhr.open('GET', url);
|
||||
xhr.onreadystatechange = handler;
|
||||
xhr.responseType = 'json';
|
||||
xhr.setRequestHeader('Accept', 'application/json');
|
||||
xhr.send();
|
||||
|
||||
function handler() {
|
||||
if (this.readyState === this.DONE) {
|
||||
if (this.status === 200) {
|
||||
resolve(this.response);
|
||||
} else {
|
||||
reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
getJSON('/posts.json').then(function(json) {
|
||||
// on fulfillment
|
||||
}, function(reason) {
|
||||
// on rejection
|
||||
});
|
||||
```
|
||||
|
||||
Unlike callbacks, promises are great composable primitives.
|
||||
|
||||
```js
|
||||
Promise.all([
|
||||
getJSON('/posts'),
|
||||
getJSON('/comments')
|
||||
]).then(function(values){
|
||||
values[0] // => postsJSON
|
||||
values[1] // => commentsJSON
|
||||
|
||||
return values;
|
||||
});
|
||||
```
|
||||
|
||||
@class Promise
|
||||
@param {function} resolver
|
||||
Useful for tooling.
|
||||
@constructor
|
||||
*/
|
||||
function lib$es6$promise$promise$$Promise(resolver) {
|
||||
this._id = lib$es6$promise$promise$$counter++;
|
||||
this._state = undefined;
|
||||
this._result = undefined;
|
||||
this._subscribers = [];
|
||||
|
||||
if (lib$es6$promise$$internal$$noop !== resolver) {
|
||||
if (!lib$es6$promise$utils$$isFunction(resolver)) {
|
||||
lib$es6$promise$promise$$needsResolver();
|
||||
}
|
||||
|
||||
if (!(this instanceof lib$es6$promise$promise$$Promise)) {
|
||||
lib$es6$promise$promise$$needsNew();
|
||||
}
|
||||
|
||||
lib$es6$promise$$internal$$initializePromise(this, resolver);
|
||||
}
|
||||
}
|
||||
|
||||
lib$es6$promise$promise$$Promise.all = lib$es6$promise$promise$all$$default;
|
||||
lib$es6$promise$promise$$Promise.race = lib$es6$promise$promise$race$$default;
|
||||
lib$es6$promise$promise$$Promise.resolve = lib$es6$promise$promise$resolve$$default;
|
||||
lib$es6$promise$promise$$Promise.reject = lib$es6$promise$promise$reject$$default;
|
||||
lib$es6$promise$promise$$Promise._setScheduler = lib$es6$promise$asap$$setScheduler;
|
||||
lib$es6$promise$promise$$Promise._setAsap = lib$es6$promise$asap$$setAsap;
|
||||
lib$es6$promise$promise$$Promise._asap = lib$es6$promise$asap$$asap;
|
||||
|
||||
lib$es6$promise$promise$$Promise.prototype = {
|
||||
constructor: lib$es6$promise$promise$$Promise,
|
||||
|
||||
/**
|
||||
The primary way of interacting with a promise is through its `then` method,
|
||||
which registers callbacks to receive either a promise's eventual value or the
|
||||
reason why the promise cannot be fulfilled.
|
||||
|
||||
```js
|
||||
findUser().then(function(user){
|
||||
// user is available
|
||||
}, function(reason){
|
||||
// user is unavailable, and you are given the reason why
|
||||
});
|
||||
```
|
||||
|
||||
Chaining
|
||||
--------
|
||||
|
||||
The return value of `then` is itself a promise. This second, 'downstream'
|
||||
promise is resolved with the return value of the first promise's fulfillment
|
||||
or rejection handler, or rejected if the handler throws an exception.
|
||||
|
||||
```js
|
||||
findUser().then(function (user) {
|
||||
return user.name;
|
||||
}, function (reason) {
|
||||
return 'default name';
|
||||
}).then(function (userName) {
|
||||
// If `findUser` fulfilled, `userName` will be the user's name, otherwise it
|
||||
// will be `'default name'`
|
||||
});
|
||||
|
||||
findUser().then(function (user) {
|
||||
throw new Error('Found user, but still unhappy');
|
||||
}, function (reason) {
|
||||
throw new Error('`findUser` rejected and we're unhappy');
|
||||
}).then(function (value) {
|
||||
// never reached
|
||||
}, function (reason) {
|
||||
// if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
|
||||
// If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
|
||||
});
|
||||
```
|
||||
If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
|
||||
|
||||
```js
|
||||
findUser().then(function (user) {
|
||||
throw new PedagogicalException('Upstream error');
|
||||
}).then(function (value) {
|
||||
// never reached
|
||||
}).then(function (value) {
|
||||
// never reached
|
||||
}, function (reason) {
|
||||
// The `PedgagocialException` is propagated all the way down to here
|
||||
});
|
||||
```
|
||||
|
||||
Assimilation
|
||||
------------
|
||||
|
||||
Sometimes the value you want to propagate to a downstream promise can only be
|
||||
retrieved asynchronously. This can be achieved by returning a promise in the
|
||||
fulfillment or rejection handler. The downstream promise will then be pending
|
||||
until the returned promise is settled. This is called *assimilation*.
|
||||
|
||||
```js
|
||||
findUser().then(function (user) {
|
||||
return findCommentsByAuthor(user);
|
||||
}).then(function (comments) {
|
||||
// The user's comments are now available
|
||||
});
|
||||
```
|
||||
|
||||
If the assimliated promise rejects, then the downstream promise will also reject.
|
||||
|
||||
```js
|
||||
findUser().then(function (user) {
|
||||
return findCommentsByAuthor(user);
|
||||
}).then(function (comments) {
|
||||
// If `findCommentsByAuthor` fulfills, we'll have the value here
|
||||
}, function (reason) {
|
||||
// If `findCommentsByAuthor` rejects, we'll have the reason here
|
||||
});
|
||||
```
|
||||
|
||||
Simple Example
|
||||
--------------
|
||||
|
||||
Synchronous Example
|
||||
|
||||
```javascript
|
||||
var result;
|
||||
|
||||
try {
|
||||
result = findResult();
|
||||
// success
|
||||
} catch(reason) {
|
||||
// failure
|
||||
}
|
||||
```
|
||||
|
||||
Errback Example
|
||||
|
||||
```js
|
||||
findResult(function(result, err){
|
||||
if (err) {
|
||||
// failure
|
||||
} else {
|
||||
// success
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Promise Example;
|
||||
|
||||
```javascript
|
||||
findResult().then(function(result){
|
||||
// success
|
||||
}, function(reason){
|
||||
// failure
|
||||
});
|
||||
```
|
||||
|
||||
Advanced Example
|
||||
--------------
|
||||
|
||||
Synchronous Example
|
||||
|
||||
```javascript
|
||||
var author, books;
|
||||
|
||||
try {
|
||||
author = findAuthor();
|
||||
books = findBooksByAuthor(author);
|
||||
// success
|
||||
} catch(reason) {
|
||||
// failure
|
||||
}
|
||||
```
|
||||
|
||||
Errback Example
|
||||
|
||||
```js
|
||||
|
||||
function foundBooks(books) {
|
||||
|
||||
}
|
||||
|
||||
function failure(reason) {
|
||||
|
||||
}
|
||||
|
||||
findAuthor(function(author, err){
|
||||
if (err) {
|
||||
failure(err);
|
||||
// failure
|
||||
} else {
|
||||
try {
|
||||
findBoooksByAuthor(author, function(books, err) {
|
||||
if (err) {
|
||||
failure(err);
|
||||
} else {
|
||||
try {
|
||||
foundBooks(books);
|
||||
} catch(reason) {
|
||||
failure(reason);
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch(error) {
|
||||
failure(err);
|
||||
}
|
||||
// success
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Promise Example;
|
||||
|
||||
```javascript
|
||||
findAuthor().
|
||||
then(findBooksByAuthor).
|
||||
then(function(books){
|
||||
// found books
|
||||
}).catch(function(reason){
|
||||
// something went wrong
|
||||
});
|
||||
```
|
||||
|
||||
@method then
|
||||
@param {Function} onFulfilled
|
||||
@param {Function} onRejected
|
||||
Useful for tooling.
|
||||
@return {Promise}
|
||||
*/
|
||||
then: function(onFulfillment, onRejection) {
|
||||
var parent = this;
|
||||
var state = parent._state;
|
||||
|
||||
if (state === lib$es6$promise$$internal$$FULFILLED && !onFulfillment || state === lib$es6$promise$$internal$$REJECTED && !onRejection) {
|
||||
return this;
|
||||
}
|
||||
|
||||
var child = new this.constructor(lib$es6$promise$$internal$$noop);
|
||||
var result = parent._result;
|
||||
|
||||
if (state) {
|
||||
var callback = arguments[state - 1];
|
||||
lib$es6$promise$asap$$asap(function(){
|
||||
lib$es6$promise$$internal$$invokeCallback(state, child, callback, result);
|
||||
});
|
||||
} else {
|
||||
lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);
|
||||
}
|
||||
|
||||
return child;
|
||||
},
|
||||
|
||||
/**
|
||||
`catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
|
||||
as the catch block of a try/catch statement.
|
||||
|
||||
```js
|
||||
function findAuthor(){
|
||||
throw new Error('couldn't find that author');
|
||||
}
|
||||
|
||||
// synchronous
|
||||
try {
|
||||
findAuthor();
|
||||
} catch(reason) {
|
||||
// something went wrong
|
||||
}
|
||||
|
||||
// async with promises
|
||||
findAuthor().catch(function(reason){
|
||||
// something went wrong
|
||||
});
|
||||
```
|
||||
|
||||
@method catch
|
||||
@param {Function} onRejection
|
||||
Useful for tooling.
|
||||
@return {Promise}
|
||||
*/
|
||||
'catch': function(onRejection) {
|
||||
return this.then(null, onRejection);
|
||||
}
|
||||
};
|
||||
function lib$es6$promise$polyfill$$polyfill() {
|
||||
var local;
|
||||
|
||||
if (typeof global !== 'undefined') {
|
||||
local = global;
|
||||
} else if (typeof self !== 'undefined') {
|
||||
local = self;
|
||||
} else {
|
||||
try {
|
||||
local = Function('return this')();
|
||||
} catch (e) {
|
||||
throw new Error('polyfill failed because global object is unavailable in this environment');
|
||||
}
|
||||
}
|
||||
|
||||
var P = local.Promise;
|
||||
|
||||
if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) {
|
||||
return;
|
||||
}
|
||||
|
||||
local.Promise = lib$es6$promise$promise$$default;
|
||||
}
|
||||
var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill;
|
||||
|
||||
var lib$es6$promise$umd$$ES6Promise = {
|
||||
'Promise': lib$es6$promise$promise$$default,
|
||||
'polyfill': lib$es6$promise$polyfill$$default
|
||||
};
|
||||
|
||||
/* global define:true module:true window: true */
|
||||
if (typeof define === 'function' && define['amd']) {
|
||||
define(function() { return lib$es6$promise$umd$$ES6Promise; });
|
||||
} else if (typeof module !== 'undefined' && module['exports']) {
|
||||
module['exports'] = lib$es6$promise$umd$$ES6Promise;
|
||||
} else if (typeof this !== 'undefined') {
|
||||
this['ES6Promise'] = lib$es6$promise$umd$$ES6Promise;
|
||||
}
|
||||
|
||||
lib$es6$promise$polyfill$$default();
|
||||
}).call(this);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/*!
|
||||
* @overview es6-promise - a tiny implementation of Promises/A+.
|
||||
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
||||
* @license Licensed under MIT license
|
||||
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
|
||||
* @version 3.0.2
|
||||
*/
|
||||
|
||||
(function(){"use strict";function lib$es6$promise$utils$$objectOrFunction(x){return typeof x==="function"||typeof x==="object"&&x!==null}function lib$es6$promise$utils$$isFunction(x){return typeof x==="function"}function lib$es6$promise$utils$$isMaybeThenable(x){return typeof x==="object"&&x!==null}var lib$es6$promise$utils$$_isArray;if(!Array.isArray){lib$es6$promise$utils$$_isArray=function(x){return Object.prototype.toString.call(x)==="[object Array]"}}else{lib$es6$promise$utils$$_isArray=Array.isArray}var lib$es6$promise$utils$$isArray=lib$es6$promise$utils$$_isArray;var lib$es6$promise$asap$$len=0;var lib$es6$promise$asap$$toString={}.toString;var lib$es6$promise$asap$$vertxNext;var lib$es6$promise$asap$$customSchedulerFn;var lib$es6$promise$asap$$asap=function asap(callback,arg){lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len]=callback;lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len+1]=arg;lib$es6$promise$asap$$len+=2;if(lib$es6$promise$asap$$len===2){if(lib$es6$promise$asap$$customSchedulerFn){lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush)}else{lib$es6$promise$asap$$scheduleFlush()}}};function lib$es6$promise$asap$$setScheduler(scheduleFn){lib$es6$promise$asap$$customSchedulerFn=scheduleFn}function lib$es6$promise$asap$$setAsap(asapFn){lib$es6$promise$asap$$asap=asapFn}var lib$es6$promise$asap$$browserWindow=typeof window!=="undefined"?window:undefined;var lib$es6$promise$asap$$browserGlobal=lib$es6$promise$asap$$browserWindow||{};var lib$es6$promise$asap$$BrowserMutationObserver=lib$es6$promise$asap$$browserGlobal.MutationObserver||lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;var lib$es6$promise$asap$$isNode=typeof process!=="undefined"&&{}.toString.call(process)==="[object process]";var lib$es6$promise$asap$$isWorker=typeof Uint8ClampedArray!=="undefined"&&typeof importScripts!=="undefined"&&typeof MessageChannel!=="undefined";function lib$es6$promise$asap$$useNextTick(){return function(){process.nextTick(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useVertxTimer(){return function(){lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush)}}function lib$es6$promise$asap$$useMutationObserver(){var iterations=0;var observer=new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);var node=document.createTextNode("");observer.observe(node,{characterData:true});return function(){node.data=iterations=++iterations%2}}function lib$es6$promise$asap$$useMessageChannel(){var channel=new MessageChannel;channel.port1.onmessage=lib$es6$promise$asap$$flush;return function(){channel.port2.postMessage(0)}}function lib$es6$promise$asap$$useSetTimeout(){return function(){setTimeout(lib$es6$promise$asap$$flush,1)}}var lib$es6$promise$asap$$queue=new Array(1e3);function lib$es6$promise$asap$$flush(){for(var i=0;i<lib$es6$promise$asap$$len;i+=2){var callback=lib$es6$promise$asap$$queue[i];var arg=lib$es6$promise$asap$$queue[i+1];callback(arg);lib$es6$promise$asap$$queue[i]=undefined;lib$es6$promise$asap$$queue[i+1]=undefined}lib$es6$promise$asap$$len=0}function lib$es6$promise$asap$$attemptVertx(){try{var r=require;var vertx=r("vertx");lib$es6$promise$asap$$vertxNext=vertx.runOnLoop||vertx.runOnContext;return lib$es6$promise$asap$$useVertxTimer()}catch(e){return lib$es6$promise$asap$$useSetTimeout()}}var lib$es6$promise$asap$$scheduleFlush;if(lib$es6$promise$asap$$isNode){lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useNextTick()}else if(lib$es6$promise$asap$$BrowserMutationObserver){lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMutationObserver()}else if(lib$es6$promise$asap$$isWorker){lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useMessageChannel()}else if(lib$es6$promise$asap$$browserWindow===undefined&&typeof require==="function"){lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$attemptVertx()}else{lib$es6$promise$asap$$scheduleFlush=lib$es6$promise$asap$$useSetTimeout()}function lib$es6$promise$$internal$$noop(){}var lib$es6$promise$$internal$$PENDING=void 0;var lib$es6$promise$$internal$$FULFILLED=1;var lib$es6$promise$$internal$$REJECTED=2;var lib$es6$promise$$internal$$GET_THEN_ERROR=new lib$es6$promise$$internal$$ErrorObject;function lib$es6$promise$$internal$$selfFulfillment(){return new TypeError("You cannot resolve a promise with itself")}function lib$es6$promise$$internal$$cannotReturnOwn(){return new TypeError("A promises callback cannot return that same promise.")}function lib$es6$promise$$internal$$getThen(promise){try{return promise.then}catch(error){lib$es6$promise$$internal$$GET_THEN_ERROR.error=error;return lib$es6$promise$$internal$$GET_THEN_ERROR}}function lib$es6$promise$$internal$$tryThen(then,value,fulfillmentHandler,rejectionHandler){try{then.call(value,fulfillmentHandler,rejectionHandler)}catch(e){return e}}function lib$es6$promise$$internal$$handleForeignThenable(promise,thenable,then){lib$es6$promise$asap$$asap(function(promise){var sealed=false;var errLine truncated
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
/* */
|
||||
"format cjs";
|
||||
import Promise from './es6-promise/promise';
|
||||
import polyfill from './es6-promise/polyfill';
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
/* */
|
||||
"format cjs";
|
||||
import {
|
||||
objectOrFunction,
|
||||
isFunction
|
||||
@@ -0,0 +1,120 @@
|
||||
var len = 0;
|
||||
var toString = {}.toString;
|
||||
var vertxNext;
|
||||
var customSchedulerFn;
|
||||
|
||||
export var asap = function asap(callback, arg) {
|
||||
queue[len] = callback;
|
||||
queue[len + 1] = arg;
|
||||
len += 2;
|
||||
if (len === 2) {
|
||||
// If len is 2, that means that we need to schedule an async flush.
|
||||
// If additional callbacks are queued before the queue is flushed, they
|
||||
// will be processed by this flush that we are scheduling.
|
||||
if (customSchedulerFn) {
|
||||
customSchedulerFn(flush);
|
||||
} else {
|
||||
scheduleFlush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function setScheduler(scheduleFn) {
|
||||
customSchedulerFn = scheduleFn;
|
||||
}
|
||||
|
||||
export function setAsap(asapFn) {
|
||||
asap = asapFn;
|
||||
}
|
||||
|
||||
var browserWindow = (typeof window !== 'undefined') ? window : undefined;
|
||||
var browserGlobal = browserWindow || {};
|
||||
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
|
||||
var isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
|
||||
|
||||
// test for web worker but not in IE10
|
||||
var isWorker = typeof Uint8ClampedArray !== 'undefined' &&
|
||||
typeof importScripts !== 'undefined' &&
|
||||
typeof MessageChannel !== 'undefined';
|
||||
|
||||
// node
|
||||
function useNextTick() {
|
||||
// node version 0.10.x displays a deprecation warning when nextTick is used recursively
|
||||
// see https://github.com/cujojs/when/issues/410 for details
|
||||
return function() {
|
||||
process.nextTick(flush);
|
||||
};
|
||||
}
|
||||
|
||||
// vertx
|
||||
function useVertxTimer() {
|
||||
return function() {
|
||||
vertxNext(flush);
|
||||
};
|
||||
}
|
||||
|
||||
function useMutationObserver() {
|
||||
var iterations = 0;
|
||||
var observer = new BrowserMutationObserver(flush);
|
||||
var node = document.createTextNode('');
|
||||
observer.observe(node, { characterData: true });
|
||||
|
||||
return function() {
|
||||
node.data = (iterations = ++iterations % 2);
|
||||
};
|
||||
}
|
||||
|
||||
// web worker
|
||||
function useMessageChannel() {
|
||||
var channel = new MessageChannel();
|
||||
channel.port1.onmessage = flush;
|
||||
return function () {
|
||||
channel.port2.postMessage(0);
|
||||
};
|
||||
}
|
||||
|
||||
function useSetTimeout() {
|
||||
return function() {
|
||||
setTimeout(flush, 1);
|
||||
};
|
||||
}
|
||||
|
||||
var queue = new Array(1000);
|
||||
function flush() {
|
||||
for (var i = 0; i < len; i+=2) {
|
||||
var callback = queue[i];
|
||||
var arg = queue[i+1];
|
||||
|
||||
callback(arg);
|
||||
|
||||
queue[i] = undefined;
|
||||
queue[i+1] = undefined;
|
||||
}
|
||||
|
||||
len = 0;
|
||||
}
|
||||
|
||||
function attemptVertx() {
|
||||
try {
|
||||
var r = require;
|
||||
var vertx = r('vertx');
|
||||
vertxNext = vertx.runOnLoop || vertx.runOnContext;
|
||||
return useVertxTimer();
|
||||
} catch(e) {
|
||||
return useSetTimeout();
|
||||
}
|
||||
}
|
||||
|
||||
var scheduleFlush;
|
||||
// Decide what async method to use to triggering processing of queued callbacks:
|
||||
if (isNode) {
|
||||
scheduleFlush = useNextTick();
|
||||
} else if (BrowserMutationObserver) {
|
||||
scheduleFlush = useMutationObserver();
|
||||
} else if (isWorker) {
|
||||
scheduleFlush = useMessageChannel();
|
||||
} else if (browserWindow === undefined && typeof require === 'function') {
|
||||
scheduleFlush = attemptVertx();
|
||||
} else {
|
||||
scheduleFlush = useSetTimeout();
|
||||
}
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
/* */
|
||||
"format cjs";
|
||||
import {
|
||||
isArray,
|
||||
isMaybeThenable
|
||||
@@ -0,0 +1,26 @@
|
||||
/*global self*/
|
||||
import Promise from './promise';
|
||||
|
||||
export default function polyfill() {
|
||||
var local;
|
||||
|
||||
if (typeof global !== 'undefined') {
|
||||
local = global;
|
||||
} else if (typeof self !== 'undefined') {
|
||||
local = self;
|
||||
} else {
|
||||
try {
|
||||
local = Function('return this')();
|
||||
} catch (e) {
|
||||
throw new Error('polyfill failed because global object is unavailable in this environment');
|
||||
}
|
||||
}
|
||||
|
||||
var P = local.Promise;
|
||||
|
||||
if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) {
|
||||
return;
|
||||
}
|
||||
|
||||
local.Promise = Promise;
|
||||
}
|
||||
@@ -0,0 +1,415 @@
|
||||
import {
|
||||
isFunction
|
||||
} from './utils';
|
||||
|
||||
import {
|
||||
noop,
|
||||
subscribe,
|
||||
initializePromise,
|
||||
invokeCallback,
|
||||
FULFILLED,
|
||||
REJECTED
|
||||
} from './-internal';
|
||||
|
||||
import {
|
||||
asap,
|
||||
setAsap,
|
||||
setScheduler
|
||||
} from './asap';
|
||||
|
||||
import all from './promise/all';
|
||||
import race from './promise/race';
|
||||
import Resolve from './promise/resolve';
|
||||
import Reject from './promise/reject';
|
||||
|
||||
var counter = 0;
|
||||
|
||||
function needsResolver() {
|
||||
throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
|
||||
}
|
||||
|
||||
function needsNew() {
|
||||
throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
|
||||
}
|
||||
|
||||
export default Promise;
|
||||
/**
|
||||
Promise objects represent the eventual result of an asynchronous operation. The
|
||||
primary way of interacting with a promise is through its `then` method, which
|
||||
registers callbacks to receive either a promise's eventual value or the reason
|
||||
why the promise cannot be fulfilled.
|
||||
|
||||
Terminology
|
||||
-----------
|
||||
|
||||
- `promise` is an object or function with a `then` method whose behavior conforms to this specification.
|
||||
- `thenable` is an object or function that defines a `then` method.
|
||||
- `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
|
||||
- `exception` is a value that is thrown using the throw statement.
|
||||
- `reason` is a value that indicates why a promise was rejected.
|
||||
- `settled` the final resting state of a promise, fulfilled or rejected.
|
||||
|
||||
A promise can be in one of three states: pending, fulfilled, or rejected.
|
||||
|
||||
Promises that are fulfilled have a fulfillment value and are in the fulfilled
|
||||
state. Promises that are rejected have a rejection reason and are in the
|
||||
rejected state. A fulfillment value is never a thenable.
|
||||
|
||||
Promises can also be said to *resolve* a value. If this value is also a
|
||||
promise, then the original promise's settled state will match the value's
|
||||
settled state. So a promise that *resolves* a promise that rejects will
|
||||
itself reject, and a promise that *resolves* a promise that fulfills will
|
||||
itself fulfill.
|
||||
|
||||
|
||||
Basic Usage:
|
||||
------------
|
||||
|
||||
```js
|
||||
var promise = new Promise(function(resolve, reject) {
|
||||
// on success
|
||||
resolve(value);
|
||||
|
||||
// on failure
|
||||
reject(reason);
|
||||
});
|
||||
|
||||
promise.then(function(value) {
|
||||
// on fulfillment
|
||||
}, function(reason) {
|
||||
// on rejection
|
||||
});
|
||||
```
|
||||
|
||||
Advanced Usage:
|
||||
---------------
|
||||
|
||||
Promises shine when abstracting away asynchronous interactions such as
|
||||
`XMLHttpRequest`s.
|
||||
|
||||
```js
|
||||
function getJSON(url) {
|
||||
return new Promise(function(resolve, reject){
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
xhr.open('GET', url);
|
||||
xhr.onreadystatechange = handler;
|
||||
xhr.responseType = 'json';
|
||||
xhr.setRequestHeader('Accept', 'application/json');
|
||||
xhr.send();
|
||||
|
||||
function handler() {
|
||||
if (this.readyState === this.DONE) {
|
||||
if (this.status === 200) {
|
||||
resolve(this.response);
|
||||
} else {
|
||||
reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
getJSON('/posts.json').then(function(json) {
|
||||
// on fulfillment
|
||||
}, function(reason) {
|
||||
// on rejection
|
||||
});
|
||||
```
|
||||
|
||||
Unlike callbacks, promises are great composable primitives.
|
||||
|
||||
```js
|
||||
Promise.all([
|
||||
getJSON('/posts'),
|
||||
getJSON('/comments')
|
||||
]).then(function(values){
|
||||
values[0] // => postsJSON
|
||||
values[1] // => commentsJSON
|
||||
|
||||
return values;
|
||||
});
|
||||
```
|
||||
|
||||
@class Promise
|
||||
@param {function} resolver
|
||||
Useful for tooling.
|
||||
@constructor
|
||||
*/
|
||||
function Promise(resolver) {
|
||||
this._id = counter++;
|
||||
this._state = undefined;
|
||||
this._result = undefined;
|
||||
this._subscribers = [];
|
||||
|
||||
if (noop !== resolver) {
|
||||
if (!isFunction(resolver)) {
|
||||
needsResolver();
|
||||
}
|
||||
|
||||
if (!(this instanceof Promise)) {
|
||||
needsNew();
|
||||
}
|
||||
|
||||
initializePromise(this, resolver);
|
||||
}
|
||||
}
|
||||
|
||||
Promise.all = all;
|
||||
Promise.race = race;
|
||||
Promise.resolve = Resolve;
|
||||
Promise.reject = Reject;
|
||||
Promise._setScheduler = setScheduler;
|
||||
Promise._setAsap = setAsap;
|
||||
Promise._asap = asap;
|
||||
|
||||
Promise.prototype = {
|
||||
constructor: Promise,
|
||||
|
||||
/**
|
||||
The primary way of interacting with a promise is through its `then` method,
|
||||
which registers callbacks to receive either a promise's eventual value or the
|
||||
reason why the promise cannot be fulfilled.
|
||||
|
||||
```js
|
||||
findUser().then(function(user){
|
||||
// user is available
|
||||
}, function(reason){
|
||||
// user is unavailable, and you are given the reason why
|
||||
});
|
||||
```
|
||||
|
||||
Chaining
|
||||
--------
|
||||
|
||||
The return value of `then` is itself a promise. This second, 'downstream'
|
||||
promise is resolved with the return value of the first promise's fulfillment
|
||||
or rejection handler, or rejected if the handler throws an exception.
|
||||
|
||||
```js
|
||||
findUser().then(function (user) {
|
||||
return user.name;
|
||||
}, function (reason) {
|
||||
return 'default name';
|
||||
}).then(function (userName) {
|
||||
// If `findUser` fulfilled, `userName` will be the user's name, otherwise it
|
||||
// will be `'default name'`
|
||||
});
|
||||
|
||||
findUser().then(function (user) {
|
||||
throw new Error('Found user, but still unhappy');
|
||||
}, function (reason) {
|
||||
throw new Error('`findUser` rejected and we're unhappy');
|
||||
}).then(function (value) {
|
||||
// never reached
|
||||
}, function (reason) {
|
||||
// if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
|
||||
// If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
|
||||
});
|
||||
```
|
||||
If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
|
||||
|
||||
```js
|
||||
findUser().then(function (user) {
|
||||
throw new PedagogicalException('Upstream error');
|
||||
}).then(function (value) {
|
||||
// never reached
|
||||
}).then(function (value) {
|
||||
// never reached
|
||||
}, function (reason) {
|
||||
// The `PedgagocialException` is propagated all the way down to here
|
||||
});
|
||||
```
|
||||
|
||||
Assimilation
|
||||
------------
|
||||
|
||||
Sometimes the value you want to propagate to a downstream promise can only be
|
||||
retrieved asynchronously. This can be achieved by returning a promise in the
|
||||
fulfillment or rejection handler. The downstream promise will then be pending
|
||||
until the returned promise is settled. This is called *assimilation*.
|
||||
|
||||
```js
|
||||
findUser().then(function (user) {
|
||||
return findCommentsByAuthor(user);
|
||||
}).then(function (comments) {
|
||||
// The user's comments are now available
|
||||
});
|
||||
```
|
||||
|
||||
If the assimliated promise rejects, then the downstream promise will also reject.
|
||||
|
||||
```js
|
||||
findUser().then(function (user) {
|
||||
return findCommentsByAuthor(user);
|
||||
}).then(function (comments) {
|
||||
// If `findCommentsByAuthor` fulfills, we'll have the value here
|
||||
}, function (reason) {
|
||||
// If `findCommentsByAuthor` rejects, we'll have the reason here
|
||||
});
|
||||
```
|
||||
|
||||
Simple Example
|
||||
--------------
|
||||
|
||||
Synchronous Example
|
||||
|
||||
```javascript
|
||||
var result;
|
||||
|
||||
try {
|
||||
result = findResult();
|
||||
// success
|
||||
} catch(reason) {
|
||||
// failure
|
||||
}
|
||||
```
|
||||
|
||||
Errback Example
|
||||
|
||||
```js
|
||||
findResult(function(result, err){
|
||||
if (err) {
|
||||
// failure
|
||||
} else {
|
||||
// success
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Promise Example;
|
||||
|
||||
```javascript
|
||||
findResult().then(function(result){
|
||||
// success
|
||||
}, function(reason){
|
||||
// failure
|
||||
});
|
||||
```
|
||||
|
||||
Advanced Example
|
||||
--------------
|
||||
|
||||
Synchronous Example
|
||||
|
||||
```javascript
|
||||
var author, books;
|
||||
|
||||
try {
|
||||
author = findAuthor();
|
||||
books = findBooksByAuthor(author);
|
||||
// success
|
||||
} catch(reason) {
|
||||
// failure
|
||||
}
|
||||
```
|
||||
|
||||
Errback Example
|
||||
|
||||
```js
|
||||
|
||||
function foundBooks(books) {
|
||||
|
||||
}
|
||||
|
||||
function failure(reason) {
|
||||
|
||||
}
|
||||
|
||||
findAuthor(function(author, err){
|
||||
if (err) {
|
||||
failure(err);
|
||||
// failure
|
||||
} else {
|
||||
try {
|
||||
findBoooksByAuthor(author, function(books, err) {
|
||||
if (err) {
|
||||
failure(err);
|
||||
} else {
|
||||
try {
|
||||
foundBooks(books);
|
||||
} catch(reason) {
|
||||
failure(reason);
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch(error) {
|
||||
failure(err);
|
||||
}
|
||||
// success
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
Promise Example;
|
||||
|
||||
```javascript
|
||||
findAuthor().
|
||||
then(findBooksByAuthor).
|
||||
then(function(books){
|
||||
// found books
|
||||
}).catch(function(reason){
|
||||
// something went wrong
|
||||
});
|
||||
```
|
||||
|
||||
@method then
|
||||
@param {Function} onFulfilled
|
||||
@param {Function} onRejected
|
||||
Useful for tooling.
|
||||
@return {Promise}
|
||||
*/
|
||||
then: function(onFulfillment, onRejection) {
|
||||
var parent = this;
|
||||
var state = parent._state;
|
||||
|
||||
if (state === FULFILLED && !onFulfillment || state === REJECTED && !onRejection) {
|
||||
return this;
|
||||
}
|
||||
|
||||
var child = new this.constructor(noop);
|
||||
var result = parent._result;
|
||||
|
||||
if (state) {
|
||||
var callback = arguments[state - 1];
|
||||
asap(function(){
|
||||
invokeCallback(state, child, callback, result);
|
||||
});
|
||||
} else {
|
||||
subscribe(parent, child, onFulfillment, onRejection);
|
||||
}
|
||||
|
||||
return child;
|
||||
},
|
||||
|
||||
/**
|
||||
`catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
|
||||
as the catch block of a try/catch statement.
|
||||
|
||||
```js
|
||||
function findAuthor(){
|
||||
throw new Error('couldn't find that author');
|
||||
}
|
||||
|
||||
// synchronous
|
||||
try {
|
||||
findAuthor();
|
||||
} catch(reason) {
|
||||
// something went wrong
|
||||
}
|
||||
|
||||
// async with promises
|
||||
findAuthor().catch(function(reason){
|
||||
// something went wrong
|
||||
});
|
||||
```
|
||||
|
||||
@method catch
|
||||
@param {Function} onRejection
|
||||
Useful for tooling.
|
||||
@return {Promise}
|
||||
*/
|
||||
'catch': function(onRejection) {
|
||||
return this.then(null, onRejection);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,52 @@
|
||||
import Enumerator from '../enumerator';
|
||||
|
||||
/**
|
||||
`Promise.all` accepts an array of promises, and returns a new promise which
|
||||
is fulfilled with an array of fulfillment values for the passed promises, or
|
||||
rejected with the reason of the first passed promise to be rejected. It casts all
|
||||
elements of the passed iterable to promises as it runs this algorithm.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var promise1 = resolve(1);
|
||||
var promise2 = resolve(2);
|
||||
var promise3 = resolve(3);
|
||||
var promises = [ promise1, promise2, promise3 ];
|
||||
|
||||
Promise.all(promises).then(function(array){
|
||||
// The array here would be [ 1, 2, 3 ];
|
||||
});
|
||||
```
|
||||
|
||||
If any of the `promises` given to `all` are rejected, the first promise
|
||||
that is rejected will be given as an argument to the returned promises's
|
||||
rejection handler. For example:
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var promise1 = resolve(1);
|
||||
var promise2 = reject(new Error("2"));
|
||||
var promise3 = reject(new Error("3"));
|
||||
var promises = [ promise1, promise2, promise3 ];
|
||||
|
||||
Promise.all(promises).then(function(array){
|
||||
// Code here never runs because there are rejected promises!
|
||||
}, function(error) {
|
||||
// error.message === "2"
|
||||
});
|
||||
```
|
||||
|
||||
@method all
|
||||
@static
|
||||
@param {Array} entries array of promises
|
||||
@param {String} label optional string for labeling the promise.
|
||||
Useful for tooling.
|
||||
@return {Promise} promise that is fulfilled when all `promises` have been
|
||||
fulfilled, or rejected if any of them become rejected.
|
||||
@static
|
||||
*/
|
||||
export default function all(entries) {
|
||||
return new Enumerator(this, entries).promise;
|
||||
}
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
/* */
|
||||
"format cjs";
|
||||
import {
|
||||
isArray
|
||||
} from "../utils";
|
||||
@@ -0,0 +1,46 @@
|
||||
import {
|
||||
noop,
|
||||
reject as _reject
|
||||
} from '../-internal';
|
||||
|
||||
/**
|
||||
`Promise.reject` returns a promise rejected with the passed `reason`.
|
||||
It is shorthand for the following:
|
||||
|
||||
```javascript
|
||||
var promise = new Promise(function(resolve, reject){
|
||||
reject(new Error('WHOOPS'));
|
||||
});
|
||||
|
||||
promise.then(function(value){
|
||||
// Code here doesn't run because the promise is rejected!
|
||||
}, function(reason){
|
||||
// reason.message === 'WHOOPS'
|
||||
});
|
||||
```
|
||||
|
||||
Instead of writing the above, your code now simply becomes the following:
|
||||
|
||||
```javascript
|
||||
var promise = Promise.reject(new Error('WHOOPS'));
|
||||
|
||||
promise.then(function(value){
|
||||
// Code here doesn't run because the promise is rejected!
|
||||
}, function(reason){
|
||||
// reason.message === 'WHOOPS'
|
||||
});
|
||||
```
|
||||
|
||||
@method reject
|
||||
@static
|
||||
@param {Any} reason value that the returned promise will be rejected with.
|
||||
Useful for tooling.
|
||||
@return {Promise} a promise rejected with the given `reason`.
|
||||
*/
|
||||
export default function reject(reason) {
|
||||
/*jshint validthis:true */
|
||||
var Constructor = this;
|
||||
var promise = new Constructor(noop);
|
||||
_reject(promise, reason);
|
||||
return promise;
|
||||
}
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
/* */
|
||||
"format cjs";
|
||||
import {
|
||||
noop,
|
||||
resolve as _resolve
|
||||
@@ -0,0 +1,22 @@
|
||||
export function objectOrFunction(x) {
|
||||
return typeof x === 'function' || (typeof x === 'object' && x !== null);
|
||||
}
|
||||
|
||||
export function isFunction(x) {
|
||||
return typeof x === 'function';
|
||||
}
|
||||
|
||||
export function isMaybeThenable(x) {
|
||||
return typeof x === 'object' && x !== null;
|
||||
}
|
||||
|
||||
var _isArray;
|
||||
if (!Array.isArray) {
|
||||
_isArray = function (x) {
|
||||
return Object.prototype.toString.call(x) === '[object Array]';
|
||||
};
|
||||
} else {
|
||||
_isArray = Array.isArray;
|
||||
}
|
||||
|
||||
export var isArray = _isArray;
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"name": "es6-promise",
|
||||
"namespace": "es6-promise",
|
||||
"version": "3.0.2",
|
||||
"description": "A lightweight library that provides tools for organizing asynchronous code",
|
||||
"main": "dist/es6-promise.js",
|
||||
"directories": {
|
||||
"lib": "lib"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"lib",
|
||||
"!dist/test"
|
||||
],
|
||||
"devDependencies": {
|
||||
"bower": "^1.3.9",
|
||||
"brfs": "0.0.8",
|
||||
"broccoli-es3-safe-recast": "0.0.8",
|
||||
"broccoli-es6-module-transpiler": "^0.5.0",
|
||||
"broccoli-jshint": "^0.5.1",
|
||||
"broccoli-merge-trees": "^0.1.4",
|
||||
"broccoli-replace": "^0.2.0",
|
||||
"broccoli-stew": "0.0.6",
|
||||
"broccoli-uglify-js": "^0.1.3",
|
||||
"broccoli-watchify": "^0.2.0",
|
||||
"ember-cli": "0.2.3",
|
||||
"ember-publisher": "0.0.7",
|
||||
"git-repo-version": "0.0.2",
|
||||
"json3": "^3.3.2",
|
||||
"minimatch": "^2.0.1",
|
||||
"mocha": "^1.20.1",
|
||||
"promises-aplus-tests-phantom": "^2.1.0-revise",
|
||||
"release-it": "0.0.10"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "ember build",
|
||||
"start": "ember s",
|
||||
"test": "ember test",
|
||||
"test:server": "ember test --server",
|
||||
"test:node": "ember build && mocha ./dist/test/browserify",
|
||||
"lint": "jshint lib",
|
||||
"prepublish": "ember build --environment production",
|
||||
"dry-run-release": "ember build --environment production && release-it --dry-run --non-interactive"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/jakearchibald/ES6-Promises.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jakearchibald/ES6-Promises/issues"
|
||||
},
|
||||
"browser": {
|
||||
"vertx": false
|
||||
},
|
||||
"keywords": [
|
||||
"promises",
|
||||
"futures"
|
||||
],
|
||||
"author": {
|
||||
"name": "Yehuda Katz, Tom Dale, Stefan Penner and contributors",
|
||||
"url": "Conversion to ES6 API by Jake Archibald"
|
||||
},
|
||||
"license": "MIT",
|
||||
"spm": {
|
||||
"main": "dist/es6-promise.js"
|
||||
},
|
||||
"gitHead": "6c49ef79609737bac2b496d508806a3d5e37303e",
|
||||
"homepage": "https://github.com/jakearchibald/ES6-Promises#readme",
|
||||
"_id": "es6-promise@3.0.2",
|
||||
"_shasum": "010d5858423a5f118979665f46486a95c6ee2bb6",
|
||||
"_from": "es6-promise@*",
|
||||
"_npmVersion": "2.13.4",
|
||||
"_nodeVersion": "2.2.1",
|
||||
"_npmUser": {
|
||||
"name": "stefanpenner",
|
||||
"email": "stefan.penner@gmail.com"
|
||||
},
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "jaffathecake",
|
||||
"email": "jaffathecake@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "stefanpenner",
|
||||
"email": "stefan.penner@gmail.com"
|
||||
}
|
||||
],
|
||||
"dist": {
|
||||
"shasum": "010d5858423a5f118979665f46486a95c6ee2bb6",
|
||||
"tarball": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz"
|
||||
},
|
||||
"_resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz",
|
||||
"readme": "ERROR: No README data found!"
|
||||
}
|
||||
Vendored
File renamed without changes.
+98
@@ -0,0 +1,98 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function (grunt) {
|
||||
var browsers = [
|
||||
{ browserName: 'firefox', version: '19', platform: 'XP' },
|
||||
{ browserName: 'firefox', platform: 'linux' },
|
||||
{ browserName: 'firefox', platform: 'OS X 10.10' },
|
||||
{ browserName: 'chrome', platform: 'linux' },
|
||||
{ browserName: 'chrome', platform: 'OS X 10.9' },
|
||||
{ browserName: 'chrome', platform: 'XP' },
|
||||
{ browserName: 'internet explorer', platform: 'Windows 8.1', version: '11' },
|
||||
{ browserName: 'internet explorer', platform: 'WIN8', version: '10' },
|
||||
{ browserName: 'internet explorer', platform: 'VISTA', version: '9' },
|
||||
{ browserName: 'safari', platform: 'OS X 10.6' },
|
||||
{ browserName: 'safari', platform: 'OS X 10.8' },
|
||||
{ browserName: 'safari', platform: 'OS X 10.9' },
|
||||
{ browserName: 'safari', platform: 'OS X 10.10' },
|
||||
{ browserName: 'iphone', platform: 'OS X 10.9', version: '7.1' },
|
||||
{ browserName: 'android', platform: 'Linux', version: '4.4' },
|
||||
];
|
||||
var extraBrowsers = [
|
||||
{ browserName: 'firefox', platform: 'linux', version: '30' },
|
||||
{ browserName: 'firefox', platform: 'linux', version: '25' },
|
||||
{ browserName: 'iphone', platform: 'OS X 10.8', version: '6.1' },
|
||||
{ browserName: 'iphone', platform: 'OS X 10.8', version: '5.1' },
|
||||
{ browserName: 'android', platform: 'Linux', version: '4.2' },
|
||||
// XXX haven't investigated these:
|
||||
// { browserName: 'opera', platform: 'Windows 7', version: '12' },
|
||||
// { browserName: 'opera', platform: 'Windows 2008', version: '12' }
|
||||
// { browserName: 'iphone', platform: 'OS X 10.6', version: '4.3' },
|
||||
// { browserName: 'android', platform: 'Linux', version: '4.0' },
|
||||
];
|
||||
if (grunt.option('extra')) {
|
||||
browsers = browsers.concat(extraBrowsers);
|
||||
}
|
||||
grunt.initConfig({
|
||||
connect: {
|
||||
server: {
|
||||
options: {
|
||||
base: '',
|
||||
port: 9999,
|
||||
useAvailablePort: true
|
||||
}
|
||||
}
|
||||
},
|
||||
'saucelabs-mocha': {
|
||||
all: {
|
||||
options: {
|
||||
urls: (function () {
|
||||
var urls = ['http://localhost:9999/test/'];
|
||||
if (grunt.option('extra')) {
|
||||
urls.push('http://localhost:9999/test-sham/');
|
||||
}
|
||||
return urls;
|
||||
}()),
|
||||
// tunnelTimeout: 5,
|
||||
build: process.env.TRAVIS_BUILD_NUMBER,
|
||||
tunneled: !process.env.SAUCE_HAS_TUNNEL,
|
||||
identifier: process.env.TRAVIS_JOB_NUMBER,
|
||||
sauceConfig: {
|
||||
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER
|
||||
},
|
||||
// concurrency: 3,
|
||||
browsers: browsers,
|
||||
testname: (function () {
|
||||
var testname = 'mocha';
|
||||
if (process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false') {
|
||||
testname += ' (PR ' + process.env.TRAVIS_PULL_REQUEST + ')';
|
||||
}
|
||||
if (process.env.TRAVIS_BRANCH && process.env.TRAVIS_BRANCH !== 'false') {
|
||||
testname += ' (branch ' + process.env.TRAVIS_BRANCH + ')';
|
||||
}
|
||||
return testname;
|
||||
}()),
|
||||
tags: (function () {
|
||||
var tags = [];
|
||||
if (process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST !== 'false') {
|
||||
tags.push('PR-' + process.env.TRAVIS_PULL_REQUEST);
|
||||
}
|
||||
if (process.env.TRAVIS_BRANCH && process.env.TRAVIS_BRANCH !== 'false') {
|
||||
tags.push(process.env.TRAVIS_BRANCH);
|
||||
}
|
||||
return tags;
|
||||
}())
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {}
|
||||
});
|
||||
// Loading dependencies
|
||||
for (var key in grunt.file.readJSON('package.json').devDependencies) {
|
||||
if (key !== 'grunt' && key.indexOf('grunt') === 0) {
|
||||
grunt.loadNpmTasks(key);
|
||||
}
|
||||
}
|
||||
grunt.registerTask('dev', ['connect', 'watch']);
|
||||
grunt.registerTask('sauce', ['connect', 'saucelabs-mocha']);
|
||||
};
|
||||
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
Vendored
File renamed without changes.
Vendored
-2
@@ -1,5 +1,3 @@
|
||||
/* */
|
||||
"format cjs";
|
||||
/*!
|
||||
* https://github.com/paulmillr/es6-shim
|
||||
* @license es6-shim Copyright 2013-2015 by Paul Miller (http://paulmillr.com)
|
||||
Vendored
File renamed without changes.
-2
@@ -1,5 +1,3 @@
|
||||
/* */
|
||||
"format cjs";
|
||||
/*!
|
||||
* https://github.com/paulmillr/es6-shim
|
||||
* @license es6-shim Copyright 2013-2015 by Paul Miller (http://paulmillr.com)
|
||||
Loaded 100 of 6153 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user