Commit 422cf996 authored by ibuler's avatar ibuler

Init project

parent d2334ef7

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

.idea
*.pyc
*.pyo
#!/usr/bin/env python
# ~*~ coding: utf-8 ~*~
#
from flask import Flask
from flask_socketio import SocketIO
from apps.ssh_server.utils import AppRequest
from .conf import CONFIG
app = Flask(__name__, template_folder='dist')
app.config.from_object(CONFIG)
socket_io = SocketIO(app)
api = AppRequest(app.config['NAME'])
from . import authentication, views
#!/usr/bin/env python
# ~*~ coding: utf-8 ~*~
#
from flask import g, request
from flask_httpauth import HTTPBasicAuth, HTTPTokenAuth, MultiAuth
from conf import CONFIG
from utils import get_logger, TerminalApiRequest, Dict
from . import app
from .errors import forbidden, unauthorized
NAME = CONFIG.NAME
api = TerminalApiRequest(NAME)
token_auth = HTTPTokenAuth()
basic_auth = HTTPBasicAuth()
auth = MultiAuth(token_auth, basic_auth)
@basic_auth.verify_password
def verify_password(username, password):
user = api.login(username=username, password=password, remote_addr=request.remote_addr)
if not user:
g.current_user = None
return False
else:
g.current_user = user
return True
@token_auth.verify_token
def verify_token(token):
if getattr(g, 'token') and g.token == token:
return True
else:
return False
@app.before_request
@auth.login_required
def before_request():
print('Request start')
if g.current_user is None:
print('User is None')
return unauthorized('Invalid credentials')
import sys
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
PROJECT_DIR = os.path.dirname(os.path.dirname(BASE_DIR))
sys.path.append(os.path.dirname(BASE_DIR))
sys.path.append(PROJECT_DIR)
# Use main config except define by self
from config import config as main_config, WebTerminalConfig
CONFIG = main_config.get('web_terminal', WebTerminalConfig)
npm-debug.log*
# Dependency directory
node_modules
typings
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
#idea project config files.
.idea
*.iml
demos
tsconfig.json
typings.json
.travis.yml
The MIT License (MIT)
Copyright (c) 2016 code-chunks
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Angular2-Logger
[![Build Status](https://travis-ci.org/code-chunks/angular2-logger.svg?branch=master)](https://travis-ci.org/code-chunks/angular2-logger)
[![npm version](https://badge.fury.io/js/angular2-logger.svg)](https://badge.fury.io/js/angular2-logger)
[![Join the chat at https://gitter.im/code-chunks/angular2-logger](https://badges.gitter.im/code-chunks/angular2-logger.svg)](https://gitter.im/code-chunks/angular2-logger?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/code-chunks/angular2-logger/master/LICENSE)
[![Support](https://supporter.60devs.com/api/b/cjv93jwfwck3yp8z2mn1d9gay)](https://supporter.60devs.com/give/cjv93jwfwck3yp8z2mn1d9gay)
## What is it?
A simpler **[Log4j](http://logging.apache.org/log4j/2.x/)** inspired logger module for **[Angular 2](https://angular.io/)**. Think of it as "**Log4ng**" ... get it?
This is a work in progress and is not ready for production, use with care, the API can and **will** change.
## Usage
### Quickstart
1. Install the npm module.
npm install --save angular2-logger
2. Add the `angular2-logger` library to your app. If you are following the [Angular 2's Quickstart Guide](https://angular.io/docs/ts/latest/quickstart.html) it should be something like this:
<!-- IE required polyfills, in this exact order -->
...
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<!-- Add the following line to the list of scripts: -->
<script src="node_modules/angular2-logger/bundles/angular2-logger.js"></script>
<!-- angular2-logger/bundles/angular2-logger.min.js` is also available for use in production. -->
3. Setup the Provider.
import {Logger} from "angular2-logger/core";
bootstrap( App, [ Logger ]);
4. Inject the logger into your objects and use it.
@Component({
...
})
export class App(){
constructor(private _logger:Logger){
this._logger.error('This is a priority level 1 error message...');
this._logger.warn('This is a priority level 2 warning message...');
this._logger.info('This is a priority level 3 warning message...');
this._logger.debug('This is a priority level 4 debug message...');
this._logger.log('This is a priority level 5 log message...');
}
}
By default the logger level will be set to `Level.WARN`, so you'll only see Warning and Error messages.
### Going deeper...
In order to see all of the messages you just need to change the logger message hierarchy level, you can do so:
- Dynamically using the console:
logger.level = logger.Level.LOG; // same as: logger.level = 5;
- Or using one of the predefined configuration providers:
import {Logger} from "angular2-logger/core";
bootstrap( App, [ LOG_LOGGER_PROVIDERS ]);
The available Providers are:
ERROR_LOGGER_PROVIDERS
WARN_LOGGER_PROVIDERS
INFO_LOGGER_PROVIDERS
DEBUG_LOGGER_PROVIDERS
LOG_LOGGER_PROVIDERS
OFF_LOGGER_PROVIDERS
Note: If you change the level of the Logger dynamically, that setting will be lost upon refreshing the page and set back to its default configured setting.
If you want the logger to keep this setting changed, store it in the localStorage by doing:
logger.store() // and logger.unstore() to undo.
#### Custom Configuration
If the Providers included don't meet your needs you can configure the default logger configuration by Providing custom properties:
import { Logger, Options, Level } from "angular2-logger/core";
bootstrap(AppComponent,[
//<Options> casting is optional, it'll help you with type checking if using an IDE.
provide( Options, { useValue: <Options>{ store: false } } ),
Logger
]);
As you can see you don't have to specify all of them, just the ones you want to override.
The available configuration options are:
* `level:Level` - How much detail you want to see in the logs; `Level.ERROR` (1) being the less detailed and `Level.LOG` (5) being the most. Defaults to `Level.WARN` (2).
The Hierarchy of the messages is as follows from highest to lowest priority:
0.- `Level.OFF`
1.- `Level.ERROR`
2.- `Level.WARN`
3.- `Level.INFO`
4.- `Level.DEBUG`
5.- `Level.LOG`
The Logger will log everything with higher or equal priority to the current `logger.level` set.
* `global:boolean` - Whether or not you want the created logger object to be exposed in the global scope. Defaults to `true`.
* `globalAs:string` - The window's property name that will hold the logger object created. Defaults to `'logger'`.
* `store:boolean` - Whether you want the level config to be saved in the local storage so it doesn't get lost when you refresh. Defaults to `false`.
* `storeAs:string` - The local storage key that will be used to save the level config if the store setting is true. Defaults to `'angular2.logger.level'`.
You can also override the default configuration options by extending the Options and injecting yours instead:
// from custom-logger-options.ts
...
@Injectable() export class CustomLoggerOptions(){
store: true
}
...
// from boot.ts/main.ts
...
bootstrap(AppComponent,[
provide( Options,{ useClass: CustomLoggerOptions } ),
Logger
]);
Class names like `Options` and `Level` might be too common, if you get a conflict you can rename them like this:
import { Logger, Options as LoggerOptions, Level as LoggerLevel } from "angular2-logger/core";
bootstrap(AppComponent,[
provide( LoggerOptions,{ useValue: {
level: LoggerLevel.WARN,
...
## How you can help
Filing issues is helpful but **pull requests** are even better!
## Instructions for dev environment
They are too long so try to keep up, here we go:
git clone https://github.com/code-chunks/angular2-logger.git
cd angular2-logger
npm i
Done.
## TODOs
- <del>Add a `Level.OFF` that turns off the logger</del>.
- <del>Support different loaders and modes</del>.
- <del>Add a basic demo.</del>
- <del>Minify bundle.</del>
- Ability to add logging time to the messages.
- Lazy Logging.
- Appenders.
- Support named loggers.
- Message Layout Feature.
- No coding required Dashboard UI to handle loggers.
## Breaking changes on 0.3.0
The codebase was updated to handle the breaking changes on Angular2's Release Candidate.
**Make sure you don't upgrade to this version if you haven't upgraded Angular2 to at least `2.0.0-rc.0`**
## Breaking changes on 0.2.0
The setup changed a bit to make it easier so make sure you follow up the new Quickstart.
## LICENSE
[MIT](https://opensource.org/licenses/MIT)
/**
* Created by Langley on 3/13/2016.
*/
/**
* The available options to set the Level of the Logger.
* See {@link Logger}.
*/
export declare enum Level {
OFF = 0,
ERROR = 1,
WARN = 2,
INFO = 3,
DEBUG = 4,
LOG = 5,
}
/**
* Created by Langley on 3/13/2016.
*/
"use strict";
/**
* The available options to set the Level of the Logger.
* See {@link Logger}.
*/
(function (Level) {
Level[Level["OFF"] = 0] = "OFF";
Level[Level["ERROR"] = 1] = "ERROR";
Level[Level["WARN"] = 2] = "WARN";
Level[Level["INFO"] = 3] = "INFO";
Level[Level["DEBUG"] = 4] = "DEBUG";
Level[Level["LOG"] = 5] = "LOG";
})(exports.Level || (exports.Level = {}));
var Level = exports.Level;
//# sourceMappingURL=level.js.map
\ No newline at end of file
{"version":3,"file":"level.js","sourceRoot":"","sources":["level.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH;;;GAGG;AACH,WAAY,KAAK;IAAG,+BAAO,CAAA;IAAE,mCAAS,CAAA;IAAE,iCAAQ,CAAA;IAAE,iCAAQ,CAAA;IAAE,mCAAS,CAAA;IAAE,+BAAO,CAAA;AAAC,CAAC,EAApE,aAAK,KAAL,aAAK,QAA+D;AAAhF,IAAY,KAAK,GAAL,aAAoE,CAAA"}
\ No newline at end of file
/**
* Created by Langley on 3/13/2016.
*/
/**
* The available options to set the Level of the Logger.
* See {@link Logger}.
*/
export enum Level { OFF = 0, ERROR = 1, WARN = 2, INFO = 3, DEBUG = 4, LOG = 5 }
\ No newline at end of file
import { Level } from "./level";
/**
* Logger options.
* See {@link Logger}.
*
* level - How much detail you want to see in the logs, 1 being the less detailed, 5 being the most. Defaults to WARN.
* global - Whether you want the created logger object to be exposed in the global scope. Defaults to true.
* globalAs - The window's property name that will hold the logger object created. Defaults to 'logger'.
* store - Whether you want the level config to be saved in the local storage so it doesn't get lost when you refresh. Defaults to false.
* storeAs - The local storage key that will be used to save the level config if the store setting is true. Defaults to 'angular2.logger.level'.
*
* Created by Langley on 3/23/2016.
*
*/
export declare class Options {
level: Level;
global: boolean;
globalAs: string;
store: boolean;
storeAs: string;
}
export declare class Logger {
private _level;
private _globalAs;
private _store;
private _storeAs;
Level: any;
constructor(options?: Options);
private _loadLevel;
private _storeLevel(level);
error(message?: any, ...optionalParams: any[]): void;
warn(message?: any, ...optionalParams: any[]): void;
info(message?: any, ...optionalParams: any[]): void;
debug(message?: any, ...optionalParams: any[]): void;
log(message?: any, ...optionalParams: any[]): void;
global: () => this;
store(): Logger;
unstore(): Logger;
isErrorEnabled: () => boolean;
isWarnEnabled: () => boolean;
isInfoEnabled: () => boolean;
isDebugEnabled: () => boolean;
isLogEnabled: () => boolean;
level: Level;
}
"use strict";
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 __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var core_1 = require("@angular/core");
var level_1 = require("./level");
/**
* Logger options.
* See {@link Logger}.
*
* level - How much detail you want to see in the logs, 1 being the less detailed, 5 being the most. Defaults to WARN.
* global - Whether you want the created logger object to be exposed in the global scope. Defaults to true.
* globalAs - The window's property name that will hold the logger object created. Defaults to 'logger'.
* store - Whether you want the level config to be saved in the local storage so it doesn't get lost when you refresh. Defaults to false.
* storeAs - The local storage key that will be used to save the level config if the store setting is true. Defaults to 'angular2.logger.level'.
*
* Created by Langley on 3/23/2016.
*
*/
var Options = (function () {
function Options() {
}
return Options;
}());
exports.Options = Options;
// Temporal until https://github.com/angular/angular/issues/7344 gets fixed.
var DEFAULT_OPTIONS = {
level: level_1.Level.WARN,
global: true,
globalAs: "logger",
store: false,
storeAs: "angular2.logger.level"
};
var Logger = (function () {
function Logger(options) {
var _this = this;
this.Level = level_1.Level;
this._loadLevel = function () { return localStorage.getItem(_this._storeAs); };
this.global = function () { return window[_this._globalAs] = _this; };
this.isErrorEnabled = function () { return _this.level >= level_1.Level.ERROR; };
this.isWarnEnabled = function () { return _this.level >= level_1.Level.WARN; };
this.isInfoEnabled = function () { return _this.level >= level_1.Level.INFO; };
this.isDebugEnabled = function () { return _this.level >= level_1.Level.DEBUG; };
this.isLogEnabled = function () { return _this.level >= level_1.Level.LOG; };
// Move this to the constructor definition when optional parameters are working with @Injectable: https://github.com/angular/angular/issues/7344
var _a = Object.assign({}, DEFAULT_OPTIONS, options), level = _a.level, global = _a.global, globalAs = _a.globalAs, store = _a.store, storeAs = _a.storeAs;
this._level = level;
this._globalAs = globalAs;
this._storeAs = storeAs;
global && this.global();
if (store || this._loadLevel())
this.store();
}
Logger.prototype._storeLevel = function (level) { localStorage[this._storeAs] = level; };
Logger.prototype.error = function (message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
this.isErrorEnabled() && console.error.apply(console, arguments);
};
Logger.prototype.warn = function (message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
this.isWarnEnabled() && console.warn.apply(console, arguments);
};
Logger.prototype.info = function (message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
this.isInfoEnabled() && console.info.apply(console, arguments);
};
Logger.prototype.debug = function (message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
this.isDebugEnabled() && console.debug.apply(console, arguments);
};
Logger.prototype.log = function (message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
this.isLogEnabled() && console.log.apply(console, arguments);
};
Logger.prototype.store = function () {
this._store = true;
var storedLevel = this._loadLevel();
if (storedLevel) {
this._level = storedLevel;
}
else {
this._storeLevel(this.level);
}
return this;
};
Logger.prototype.unstore = function () {
this._store = false;
localStorage.removeItem(this._storeAs);
return this;
};
Object.defineProperty(Logger.prototype, "level", {
get: function () { return this._level; },
set: function (level) {
this._store && this._storeLevel(level);
this._level = level;
},
enumerable: true,
configurable: true
});
Logger = __decorate([
core_1.Injectable(),
__param(0, core_1.Optional()),
__metadata('design:paramtypes', [Options])
], Logger);
return Logger;
}());
exports.Logger = Logger;
//# sourceMappingURL=logger.js.map
\ No newline at end of file
{"version":3,"file":"logger.js","sourceRoot":"","sources":["logger.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qBAAmC,eAAe,CAAC,CAAA;AACnD,sBAAoB,SAAS,CAAC,CAAA;AAE9B;;;;;;;;;;;;GAYG;AACH;IAAA;IAMA,CAAC;IAAD,cAAC;AAAD,CAAC,AAND,IAMC;AANY,eAAO,UAMnB,CAAA;AAED,4EAA4E;AAC5E,IAAM,eAAe,GAAY;IAC7B,KAAK,EAAE,aAAK,CAAC,IAAI;IACjB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,uBAAuB;CACnC,CAAC;AAGF;IASI,gBAAyB,OAAiB;QAT9C,iBA+EC;QAxEG,UAAK,GAAO,aAAK,CAAC;QAiBV,eAAU,GAAG,cAAa,OAAA,YAAY,CAAC,OAAO,CAAE,KAAI,CAAC,QAAQ,CAAE,EAArC,CAAqC,CAAC;QAuBxE,WAAM,GAAG,cAAM,OAAQ,MAAQ,CAAC,KAAI,CAAC,SAAS,CAAC,GAAG,KAAI,EAAvC,CAAuC,CAAC;QAmBvD,mBAAc,GAAG,cAAe,OAAA,KAAI,CAAC,KAAK,IAAI,aAAK,CAAC,KAAK,EAAzB,CAAyB,CAAC;QAC1D,kBAAa,GAAG,cAAe,OAAA,KAAI,CAAC,KAAK,IAAI,aAAK,CAAC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,yBAAK;aAAT,cAAqB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;aAE1C,UAAU,KAAY;YAClB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YACvC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACxB,CAAC;;;OALyC;IAzE9C;QAAC,iBAAU,EAAE;mBAUK,eAAQ,EAAE;;cAVf;IAgFb,aAAC;AAAD,CAAC,AA/ED,IA+EC;AA/EY,cAAM,SA+ElB,CAAA"}
\ No newline at end of file
import {Injectable, Optional} from "@angular/core";
import {Level} from "./level";
/**
* Logger options.
* See {@link Logger}.
*
* level - How much detail you want to see in the logs, 1 being the less detailed, 5 being the most. Defaults to WARN.
* global - Whether you want the created logger object to be exposed in the global scope. Defaults to true.
* globalAs - The window's property name that will hold the logger object created. Defaults to 'logger'.
* store - Whether you want the level config to be saved in the local storage so it doesn't get lost when you refresh. Defaults to false.
* storeAs - The local storage key that will be used to save the level config if the store setting is true. Defaults to 'angular2.logger.level'.
*
* Created by Langley on 3/23/2016.
*
*/
export class Options {
level: Level;
global: boolean;
globalAs: string;
store: boolean;
storeAs: string;
}
// Temporal until https://github.com/angular/angular/issues/7344 gets fixed.
const DEFAULT_OPTIONS: Options = {
level: Level.WARN,
global: true,
globalAs: "logger",
store: false,
storeAs: "angular2.logger.level"
};
@Injectable()
export class Logger {
private _level: Level;
private _globalAs: string;
private _store: boolean;
private _storeAs: string;
Level:any = Level;
constructor( @Optional() options?: Options ) {
// Move this to the constructor definition when optional parameters are working with @Injectable: https://github.com/angular/angular/issues/7344
let { level, global, globalAs, store, storeAs } = Object.assign( {}, DEFAULT_OPTIONS, options );
this._level = level;
this._globalAs = globalAs;
this._storeAs = storeAs;
global && this.global();
if ( store || this._loadLevel() ) this.store();
}
private _loadLevel = (): Level => localStorage.getItem( this._storeAs );
private _storeLevel(level: Level) { localStorage[ this._storeAs ] = level; }
error(message?: any, ...optionalParams: any[]) {
this.isErrorEnabled() && console.error.apply( console, arguments );
}
warn(message?: any, ...optionalParams: any[]) {
this.isWarnEnabled() && console.warn.apply( console, arguments );
}
info(message?: any, ...optionalParams: any[]) {
this.isInfoEnabled() && console.info.apply( console, arguments );
}
debug(message?: any, ...optionalParams: any[]) {
this.isDebugEnabled() && console.debug.apply( console, arguments );
}
log(message?: any, ...optionalParams: any[]) {
this.isLogEnabled() && console.log.apply( console, arguments );
}
global = () => ( <any> window )[this._globalAs] = this;
store(): Logger {
this._store = true;
let storedLevel = this._loadLevel();
if ( storedLevel ) { this._level = storedLevel; }
else { this._storeLevel( this.level ); }
return this;
}
unstore(): Logger {
this._store = false;
localStorage.removeItem( this._storeAs );
return this;
}
isErrorEnabled = (): boolean => this.level >= Level.ERROR;
isWarnEnabled = (): boolean => this.level >= Level.WARN;
isInfoEnabled = (): boolean => this.level >= Level.INFO;
isDebugEnabled = (): boolean => this.level >= Level.DEBUG;
isLogEnabled = (): boolean => this.level >= Level.LOG;
get level(): Level { return this._level; }
set level(level: Level) {
this._store && this._storeLevel(level);
this._level = level;
}
}
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 __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
System.register("angular2-logger/app/core/level", [], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var Level;
return {
setters:[],
execute: function() {
(function (Level) {
Level[Level["OFF"] = 0] = "OFF";
Level[Level["ERROR"] = 1] = "ERROR";
Level[Level["WARN"] = 2] = "WARN";
Level[Level["INFO"] = 3] = "INFO";
Level[Level["DEBUG"] = 4] = "DEBUG";
Level[Level["LOG"] = 5] = "LOG";
})(Level || (Level = {}));
exports_1("Level", Level);
}
}
});
System.register("angular2-logger/app/core/logger", ["@angular/core", "angular2-logger/app/core/level"], function(exports_2, context_2) {
"use strict";
var __moduleName = context_2 && context_2.id;
var core_1, level_1;
var Options, DEFAULT_OPTIONS, Logger;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (level_1_1) {
level_1 = level_1_1;
}],
execute: function() {
Options = (function () {
function Options() {
}
return Options;
}());
exports_2("Options", Options);
DEFAULT_OPTIONS = {
level: level_1.Level.WARN,
global: true,
globalAs: "logger",
store: false,
storeAs: "angular2.logger.level"
};
Logger = (function () {
function Logger(options) {
var _this = this;
this.Level = level_1.Level;
this._loadLevel = function () { return localStorage.getItem(_this._storeAs); };
this.global = function () { return window[_this._globalAs] = _this; };
this.isErrorEnabled = function () { return _this.level >= level_1.Level.ERROR; };
this.isWarnEnabled = function () { return _this.level >= level_1.Level.WARN; };
this.isInfoEnabled = function () { return _this.level >= level_1.Level.INFO; };
this.isDebugEnabled = function () { return _this.level >= level_1.Level.DEBUG; };
this.isLogEnabled = function () { return _this.level >= level_1.Level.LOG; };
var _a = Object.assign({}, DEFAULT_OPTIONS, options), level = _a.level, global = _a.global, globalAs = _a.globalAs, store = _a.store, storeAs = _a.storeAs;
this._level = level;
this._globalAs = globalAs;
this._storeAs = storeAs;
global && this.global();
if (store || this._loadLevel())
this.store();
}
Logger.prototype._storeLevel = function (level) { localStorage[this._storeAs] = level; };
Logger.prototype.error = function (message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
this.isErrorEnabled() && console.error.apply(console, arguments);
};
Logger.prototype.warn = function (message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
this.isWarnEnabled() && console.warn.apply(console, arguments);
};
Logger.prototype.info = function (message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
this.isInfoEnabled() && console.info.apply(console, arguments);
};
Logger.prototype.debug = function (message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
this.isDebugEnabled() && console.debug.apply(console, arguments);
};
Logger.prototype.log = function (message) {
var optionalParams = [];
for (var _i = 1; _i < arguments.length; _i++) {
optionalParams[_i - 1] = arguments[_i];
}
this.isLogEnabled() && console.log.apply(console, arguments);
};
Logger.prototype.store = function () {
this._store = true;
var storedLevel = this._loadLevel();
if (storedLevel) {
this._level = storedLevel;
}
else {
this._storeLevel(this.level);
}
return this;
};
Logger.prototype.unstore = function () {
this._store = false;
localStorage.removeItem(this._storeAs);
return this;
};
Object.defineProperty(Logger.prototype, "level", {
get: function () { return this._level; },
set: function (level) {
this._store && this._storeLevel(level);
this._level = level;
},
enumerable: true,
configurable: true
});
Logger = __decorate([
core_1.Injectable(),
__param(0, core_1.Optional()),
__metadata('design:paramtypes', [Options])
], Logger);
return Logger;
}());
exports_2("Logger", Logger);
}
}
});
System.register("angular2-logger/core", ["@angular/core", "angular2-logger/app/core/logger", "angular2-logger/app/core/level"], function(exports_3, context_3) {
"use strict";
var __moduleName = context_3 && context_3.id;
var core_2, logger_1, level_2;
var OFF_LOGGER_PROVIDERS, ERROR_LOGGER_PROVIDERS, WARN_LOGGER_PROVIDERS, INFO_LOGGER_PROVIDERS, DEBUG_LOGGER_PROVIDERS, LOG_LOGGER_PROVIDERS;
var exportedNames_1 = {
'OFF_LOGGER_PROVIDERS': true,
'ERROR_LOGGER_PROVIDERS': true,
'WARN_LOGGER_PROVIDERS': true,
'INFO_LOGGER_PROVIDERS': true,
'DEBUG_LOGGER_PROVIDERS': true,
'LOG_LOGGER_PROVIDERS': true
};
function exportStar_1(m) {
var exports = {};
for(var n in m) {
if (n !== "default"&& !exportedNames_1.hasOwnProperty(n)) exports[n] = m[n];
}
exports_3(exports);
}
return {
setters:[
function (core_2_1) {
core_2 = core_2_1;
},
function (logger_1_1) {
logger_1 = logger_1_1;
exportStar_1(logger_1_1);
},
function (level_2_1) {
level_2 = level_2_1;
exportStar_1(level_2_1);
}],
execute: function() {
exports_3("OFF_LOGGER_PROVIDERS", OFF_LOGGER_PROVIDERS = [core_2.provide(logger_1.Options, { useValue: { level: level_2.Level.OFF } }), logger_1.Logger]);
exports_3("ERROR_LOGGER_PROVIDERS", ERROR_LOGGER_PROVIDERS = [core_2.provide(logger_1.Options, { useValue: { level: level_2.Level.ERROR } }), logger_1.Logger]);
exports_3("WARN_LOGGER_PROVIDERS", WARN_LOGGER_PROVIDERS = [core_2.provide(logger_1.Options, { useValue: { level: level_2.Level.WARN } }), logger_1.Logger]);
exports_3("INFO_LOGGER_PROVIDERS", INFO_LOGGER_PROVIDERS = [core_2.provide(logger_1.Options, { useValue: { level: level_2.Level.INFO } }), logger_1.Logger]);
exports_3("DEBUG_LOGGER_PROVIDERS", DEBUG_LOGGER_PROVIDERS = [core_2.provide(logger_1.Options, { useValue: { level: level_2.Level.DEBUG } }), logger_1.Logger]);
exports_3("LOG_LOGGER_PROVIDERS", LOG_LOGGER_PROVIDERS = [core_2.provide(logger_1.Options, { useValue: { level: level_2.Level.LOG } }), logger_1.Logger]);
}
}
});
//# sourceMappingURL=angular2-logger.js.map
\ No newline at end of file
{"version":3,"file":"angular2-logger.js","sourceRoot":"","sources":["../app/core/level.ts","../app/core/logger.ts","../core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;YAQA,WAAY,KAAK;gBAAG,+BAAO,CAAA;gBAAE,mCAAS,CAAA;gBAAE,iCAAQ,CAAA;gBAAE,iCAAQ,CAAA;gBAAE,mCAAS,CAAA;gBAAE,+BAAO,CAAA;YAAC,CAAC,EAApE,KAAK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qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YALpB,kCAAA,oBAAoB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,GAAG,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAA,CAAC;YACjG,oCAAA,sBAAsB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,KAAK,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAA,CAAC;YACrG,mCAAA,qBAAqB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,IAAI,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAA,CAAC;YACnG,mCAAA,qBAAqB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,IAAI,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAA,CAAC;YACnG,oCAAA,sBAAsB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,KAAK,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAA,CAAC;YACrG,kCAAA,oBAAoB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,GAAG,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAA,CAAC"}
\ No newline at end of file
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 __param=this&&this.__param||function(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex)}};System.register("angular2-logger/app/core/level",[],function(exports_1,context_1){"use strict";var __moduleName=context_1&&context_1.id;var Level;return{setters:[],execute:function(){(function(Level){Level[Level["OFF"]=0]="OFF";Level[Level["ERROR"]=1]="ERROR";Level[Level["WARN"]=2]="WARN";Level[Level["INFO"]=3]="INFO";Level[Level["DEBUG"]=4]="DEBUG";Level[Level["LOG"]=5]="LOG"})(Level||(Level={}));exports_1("Level",Level)}}});System.register("angular2-logger/app/core/logger",["@angular/core","angular2-logger/app/core/level"],function(exports_2,context_2){"use strict";var __moduleName=context_2&&context_2.id;var core_1,level_1;var Options,DEFAULT_OPTIONS,Logger;return{setters:[function(core_1_1){core_1=core_1_1},function(level_1_1){level_1=level_1_1}],execute:function(){Options=function(){function Options(){}return Options}();exports_2("Options",Options);DEFAULT_OPTIONS={level:level_1.Level.WARN,global:true,globalAs:"logger",store:false,storeAs:"angular2.logger.level"};Logger=function(){function Logger(options){var _this=this;this.Level=level_1.Level;this._loadLevel=function(){return localStorage.getItem(_this._storeAs)};this.global=function(){return window[_this._globalAs]=_this};this.isErrorEnabled=function(){return _this.level>=level_1.Level.ERROR};this.isWarnEnabled=function(){return _this.level>=level_1.Level.WARN};this.isInfoEnabled=function(){return _this.level>=level_1.Level.INFO};this.isDebugEnabled=function(){return _this.level>=level_1.Level.DEBUG};this.isLogEnabled=function(){return _this.level>=level_1.Level.LOG};var _a=Object.assign({},DEFAULT_OPTIONS,options),level=_a.level,global=_a.global,globalAs=_a.globalAs,store=_a.store,storeAs=_a.storeAs;this._level=level;this._globalAs=globalAs;this._storeAs=storeAs;global&&this.global();if(store||this._loadLevel())this.store()}Logger.prototype._storeLevel=function(level){localStorage[this._storeAs]=level};Logger.prototype.error=function(message){var optionalParams=[];for(var _i=1;_i<arguments.length;_i++){optionalParams[_i-1]=arguments[_i]}this.isErrorEnabled()&&console.error.apply(console,arguments)};Logger.prototype.warn=function(message){var optionalParams=[];for(var _i=1;_i<arguments.length;_i++){optionalParams[_i-1]=arguments[_i]}this.isWarnEnabled()&&console.warn.apply(console,arguments)};Logger.prototype.info=function(message){var optionalParams=[];for(var _i=1;_i<arguments.length;_i++){optionalParams[_i-1]=arguments[_i]}this.isInfoEnabled()&&console.info.apply(console,arguments)};Logger.prototype.debug=function(message){var optionalParams=[];for(var _i=1;_i<arguments.length;_i++){optionalParams[_i-1]=arguments[_i]}this.isDebugEnabled()&&console.debug.apply(console,arguments)};Logger.prototype.log=function(message){var optionalParams=[];for(var _i=1;_i<arguments.length;_i++){optionalParams[_i-1]=arguments[_i]}this.isLogEnabled()&&console.log.apply(console,arguments)};Logger.prototype.store=function(){this._store=true;var storedLevel=this._loadLevel();if(storedLevel){this._level=storedLevel}else{this._storeLevel(this.level)}return this};Logger.prototype.unstore=function(){this._store=false;localStorage.removeItem(this._storeAs);return this};Object.defineProperty(Logger.prototype,"level",{get:function(){return this._level},set:function(level){this._store&&this._storeLevel(level);this._level=level},enumerable:true,configurable:true});Logger=__decorate([core_1.Injectable(),__param(0,core_1.Optional()),__metadata("design:paramtypes",[Options])],Logger);return Logger}();exports_2("Logger",Logger)}}});System.register("angular2-logger/core",["@angular/core","angular2-logger/app/core/logger","angular2-logger/app/core/level"],function(exports_3,context_3){"use strict";var __moduleName=context_3&&context_3.id;var core_2,logger_1,level_2;var OFF_LOGGER_PROVIDERS,ERROR_LOGGER_PROVIDERS,WARN_LOGGER_PROVIDERS,INFO_LOGGER_PROVIDERS,DEBUG_LOGGER_PROVIDERS,LOG_LOGGER_PROVIDERS;var exportedNames_1={OFF_LOGGER_PROVIDERS:true,ERROR_LOGGER_PROVIDERS:true,WARN_LOGGER_PROVIDERS:true,INFO_LOGGER_PROVIDERS:true,DEBUG_LOGGER_PROVIDERS:true,LOG_LOGGER_PROVIDERS:true};function exportStar_1(m){var exports={};for(var n in m){if(n!=="default"&&!exportedNames_1.hasOwnProperty(n))exports[n]=m[n]}exports_3(exports)}return{setters:[function(core_2_1){core_2=core_2_1},function(logger_1_1){logger_1=logger_1_1;exportStar_1(logger_1_1)},function(level_2_1){level_2=level_2_1;exportStar_1(level_2_1)}],execute:function(){exports_3("OFF_LOGGER_PROVIDERS",OFF_LOGGER_PROVIDERS=[core_2.provide(logger_1.Options,{useValue:{level:level_2.Level.OFF}}),logger_1.Logger]);exports_3("ERROR_LOGGER_PROVIDERS",ERROR_LOGGER_PROVIDERS=[core_2.provide(logger_1.Options,{useValue:{level:level_2.Level.ERROR}}),logger_1.Logger]);exports_3("WARN_LOGGER_PROVIDERS",WARN_LOGGER_PROVIDERS=[core_2.provide(logger_1.Options,{useValue:{level:level_2.Level.WARN}}),logger_1.Logger]);exports_3("INFO_LOGGER_PROVIDERS",INFO_LOGGER_PROVIDERS=[core_2.provide(logger_1.Options,{useValue:{level:level_2.Level.INFO}}),logger_1.Logger]);exports_3("DEBUG_LOGGER_PROVIDERS",DEBUG_LOGGER_PROVIDERS=[core_2.provide(logger_1.Options,{useValue:{level:level_2.Level.DEBUG}}),logger_1.Logger]);exports_3("LOG_LOGGER_PROVIDERS",LOG_LOGGER_PROVIDERS=[core_2.provide(logger_1.Options,{useValue:{level:level_2.Level.LOG}}),logger_1.Logger])}}});
\ No newline at end of file
/**
* @module
* @description
* Public API.
*/
export * from "./app/core/level";
export * from "./app/core/logger";
/**
* Custom Providers if the user wants to avoid some configuration for common scenarios.
* @type {Provider|Logger[]}
*/
export declare const OFF_LOGGER_PROVIDERS: any[];
export declare const ERROR_LOGGER_PROVIDERS: any[];
export declare const WARN_LOGGER_PROVIDERS: any[];
export declare const INFO_LOGGER_PROVIDERS: any[];
export declare const DEBUG_LOGGER_PROVIDERS: any[];
export declare const LOG_LOGGER_PROVIDERS: any[];
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var core_1 = require("@angular/core");
var logger_1 = require("./app/core/logger");
var level_1 = require("./app/core/level");
/**
* @module
* @description
* Public API.
*/
__export(require("./app/core/level"));
__export(require("./app/core/logger"));
/**
* Custom Providers if the user wants to avoid some configuration for common scenarios.
* @type {Provider|Logger[]}
*/
exports.OFF_LOGGER_PROVIDERS = [core_1.provide(logger_1.Options, { useValue: { level: level_1.Level.OFF } }), logger_1.Logger];
exports.ERROR_LOGGER_PROVIDERS = [core_1.provide(logger_1.Options, { useValue: { level: level_1.Level.ERROR } }), logger_1.Logger];
exports.WARN_LOGGER_PROVIDERS = [core_1.provide(logger_1.Options, { useValue: { level: level_1.Level.WARN } }), logger_1.Logger];
exports.INFO_LOGGER_PROVIDERS = [core_1.provide(logger_1.Options, { useValue: { level: level_1.Level.INFO } }), logger_1.Logger];
exports.DEBUG_LOGGER_PROVIDERS = [core_1.provide(logger_1.Options, { useValue: { level: level_1.Level.DEBUG } }), logger_1.Logger];
exports.LOG_LOGGER_PROVIDERS = [core_1.provide(logger_1.Options, { useValue: { level: level_1.Level.LOG } }), logger_1.Logger];
//# sourceMappingURL=core.js.map
\ No newline at end of file
{"version":3,"file":"core.js","sourceRoot":"","sources":["core.ts"],"names":[],"mappings":";;;;AAAA,qBAAsB,eAAe,CAAC,CAAA;AACtC,uBAA8B,mBAAmB,CAAC,CAAA;AAClD,sBAAoB,kBAAkB,CAAC,CAAA;AAEvC;;;;GAIG;AACH,iBAAc,kBAAkB,CAAC,EAAA;AACjC,iBAAc,mBAAmB,CAAC,EAAA;AAElC;;;GAGG;AACU,4BAAoB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,GAAG,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAC;AACjG,8BAAsB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,KAAK,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAC;AACrG,6BAAqB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,IAAI,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAC;AACnG,6BAAqB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,IAAI,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAC;AACnG,8BAAsB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,KAAK,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAC;AACrG,4BAAoB,GAAU,CAAE,cAAO,CAAE,gBAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,aAAK,CAAC,GAAG,EAAE,EAAE,CAAE,EAAE,eAAM,CAAE,CAAC"}
\ No newline at end of file
import {provide} from "@angular/core";
import {Options, Logger} from "./app/core/logger";
import {Level} from "./app/core/level";
/**
* @module
* @description
* Public API.
*/
export * from "./app/core/level";
export * from "./app/core/logger";
/**
* Custom Providers if the user wants to avoid some configuration for common scenarios.
* @type {Provider|Logger[]}
*/
export const OFF_LOGGER_PROVIDERS: any[] = [ provide( Options, { useValue: { level: Level.OFF } } ), Logger ];
export const ERROR_LOGGER_PROVIDERS: any[] = [ provide( Options, { useValue: { level: Level.ERROR } } ), Logger ];
export const WARN_LOGGER_PROVIDERS: any[] = [ provide( Options, { useValue: { level: Level.WARN } } ), Logger ];
export const INFO_LOGGER_PROVIDERS: any[] = [ provide( Options, { useValue: { level: Level.INFO } } ), Logger ];
export const DEBUG_LOGGER_PROVIDERS: any[] = [ provide( Options, { useValue: { level: Level.DEBUG } } ), Logger ];
export const LOG_LOGGER_PROVIDERS: any[] = [ provide( Options, { useValue: { level: Level.LOG } } ), Logger ];
\ No newline at end of file
/**
* Created by Langley on 3/13/2016.
*/
/**
* The available options to set the Level of the Logger.
* See {@link Logger}.
*/
export var Level;
(function (Level) {
Level[Level["OFF"] = 0] = "OFF";
Level[Level["ERROR"] = 1] = "ERROR";
Level[Level["WARN"] = 2] = "WARN";
Level[Level["INFO"] = 3] = "INFO";
Level[Level["DEBUG"] = 4] = "DEBUG";
Level[Level["LOG"] = 5] = "LOG";
})(Level || (Level = {}));
//# sourceMappingURL=level.js.map
\ No newline at end of file
{"version":3,"file":"level.js","sourceRoot":"","sources":["../../../../app/core/level.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,WAAY,KAAoE;AAAhF,WAAY,KAAK;IAAG,+BAAO,CAAA;IAAE,mCAAS,CAAA;IAAE,iCAAQ,CAAA;IAAE,iCAAQ,CAAA;IAAE,mCAAS,CAAA;IAAE,+BAAO,CAAA;AAAC,CAAC,EAApE,KAAK,KAAL,KAAK,QAA+D"}
\ No newline at end of file
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 __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
import { Injectable, Optional } from "@angular/core";
import { Level } from "./level";
/**
* Logger options.
* See {@link Logger}.
*
* level - How much detail you want to see in the logs, 1 being the less detailed, 5 being the most. Defaults to WARN.
* global - Whether you want the created logger object to be exposed in the global scope. Defaults to true.
* globalAs - The window's property name that will hold the logger object created. Defaults to 'logger'.
* store - Whether you want the level config to be saved in the local storage so it doesn't get lost when you refresh. Defaults to false.
* storeAs - The local storage key that will be used to save the level config if the store setting is true. Defaults to 'angular2.logger.level'.
*
* Created by Langley on 3/23/2016.
*
*/
export class Options {
}
// Temporal until https://github.com/angular/angular/issues/7344 gets fixed.
const DEFAULT_OPTIONS = {
level: Level.WARN,
global: true,
globalAs: "logger",
store: false,
storeAs: "angular2.logger.level"
};
export let Logger = class Logger {
constructor(options) {
this.Level = Level;
this._loadLevel = () => localStorage.getItem(this._storeAs);
this.global = () => window[this._globalAs] = this;
this.isErrorEnabled = () => this.level >= Level.ERROR;
this.isWarnEnabled = () => this.level >= Level.WARN;
this.isInfoEnabled = () => this.level >= Level.INFO;
this.isDebugEnabled = () => this.level >= Level.DEBUG;
this.isLogEnabled = () => this.level >= Level.LOG;
// Move this to the constructor definition when optional parameters are working with @Injectable: https://github.com/angular/angular/issues/7344
let { level, global, globalAs, store, storeAs } = Object.assign({}, DEFAULT_OPTIONS, options);
this._level = level;
this._globalAs = globalAs;
this._storeAs = storeAs;
global && this.global();
if (store || this._loadLevel())
this.store();
}
_storeLevel(level) { localStorage[this._storeAs] = level; }
error(message, ...optionalParams) {
this.isErrorEnabled() && console.error.apply(console, arguments);
}
warn(message, ...optionalParams) {
this.isWarnEnabled() && console.warn.apply(console, arguments);
}
info(message, ...optionalParams) {
this.isInfoEnabled() && console.info.apply(console, arguments);
}
debug(message, ...optionalParams) {
this.isDebugEnabled() && console.debug.apply(console, arguments);
}
log(message, ...optionalParams) {
this.isLogEnabled() && console.log.apply(console, arguments);
}
store() {
this._store = true;
let storedLevel = this._loadLevel();
if (storedLevel) {
this._level = storedLevel;
}
else {
this._storeLevel(this.level);
}
return this;
}
unstore() {
this._store = false;
localStorage.removeItem(this._storeAs);
return this;
}
get level() { return this._level; }
set level(level) {
this._store && this._storeLevel(level);
this._level = level;
}
};
Logger = __decorate([
Injectable(),
__param(0, Optional()),
__metadata('design:paramtypes', [Options])
], Logger);
//# sourceMappingURL=logger.js.map
\ No newline at end of file
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../app/core/logger.ts"],"names":[],"mappings":";;;;;;;;;;;;OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,eAAe;OAC3C,EAAC,KAAK,EAAC,MAAM,SAAS;AAE7B;;;;;;;;;;;;GAYG;AACH;AAMA,CAAC;AAED,4EAA4E;AAC5E,MAAM,eAAe,GAAY;IAC7B,KAAK,EAAE,KAAK,CAAC,IAAI;IACjB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,uBAAuB;CACnC,CAAC;AAGF;IASI,YAAyB,OAAiB;QAF1C,UAAK,GAAO,KAAK,CAAC;QAiBV,eAAU,GAAG,MAAa,YAAY,CAAC,OAAO,CAAE,IAAI,CAAC,QAAQ,CAAE,CAAC;QAuBxE,WAAM,GAAG,MAAc,MAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;QAmBvD,mBAAc,GAAG,MAAe,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC;QAC1D,kBAAa,GAAG,MAAe,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC;QACxD,kBAAa,GAAG,MAAe,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC;QACxD,mBAAc,GAAG,MAAe,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC;QAC1D,iBAAY,GAAG,MAAe,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC;QA3DlD,gJAAgJ;QAChJ,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CA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C;IAID,KAAK;QAED,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QACpC,EAAE,CAAC,CAAE,WAAY,CAAC,CAAC,CAAC;YAAC,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC;QAAC,CAAC;QACjD,IAAI,CAAC,CAAC;YAAC,IAAI,CAAC,WAAW,CAAE,IAAI,CAAC,KAAK,CAAE,CAAC;QAAC,CAAC;QAExC,MAAM,CAAC,IAAI,CAAC;IAEhB,CAAC;IAED,OAAO;QACH,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,YAAY,CAAC,UAAU,CAAE,IAAI,CAAC,QAAQ,CAAE,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC;IAChB,CAAC;IAQD,IAAI,KAAK,KAAY,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAE1C,IAAI,KAAK,CAAC,KAAY;QAClB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;AAEL,CAAC;AAhFD;IAAC,UAAU,EAAE;eAUK,QAAQ,EAAE;;UAVf;AAgFZ"}
\ No newline at end of file
import { provide } from "@angular/core";
import { Options, Logger } from "./app/core/logger";
import { Level } from "./app/core/level";
/**
* @module
* @description
* Public API.
*/
export * from "./app/core/level";
export * from "./app/core/logger";
/**
* Custom Providers if the user wants to avoid some configuration for common scenarios.
* @type {Provider|Logger[]}
*/
export const OFF_LOGGER_PROVIDERS = [provide(Options, { useValue: { level: Level.OFF } }), Logger];
export const ERROR_LOGGER_PROVIDERS = [provide(Options, { useValue: { level: Level.ERROR } }), Logger];
export const WARN_LOGGER_PROVIDERS = [provide(Options, { useValue: { level: Level.WARN } }), Logger];
export const INFO_LOGGER_PROVIDERS = [provide(Options, { useValue: { level: Level.INFO } }), Logger];
export const DEBUG_LOGGER_PROVIDERS = [provide(Options, { useValue: { level: Level.DEBUG } }), Logger];
export const LOG_LOGGER_PROVIDERS = [provide(Options, { useValue: { level: Level.LOG } }), Logger];
//# sourceMappingURL=core.js.map
\ No newline at end of file
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../core.ts"],"names":[],"mappings":"OAAO,EAAC,OAAO,EAAC,MAAM,eAAe;OAC9B,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,mBAAmB;OAC1C,EAAC,KAAK,EAAC,MAAM,kBAAkB;AAEtC;;;;GAIG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAElC;;;GAGG;AACH,OAAO,MAAM,oBAAoB,GAAU,CAAE,OAAO,CAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,EAAE,EAAE,CAAE,EAAE,MAAM,CAAE,CAAC;AAC9G,OAAO,MAAM,sBAAsB,GAAU,CAAE,OAAO,CAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAE,EAAE,MAAM,CAAE,CAAC;AAClH,OAAO,MAAM,qBAAqB,GAAU,CAAE,OAAO,CAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAE,EAAE,MAAM,CAAE,CAAC;AAChH,OAAO,MAAM,qBAAqB,GAAU,CAAE,OAAO,CAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAE,EAAE,MAAM,CAAE,CAAC;AAChH,OAAO,MAAM,sBAAsB,GAAU,CAAE,OAAO,CAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAE,EAAE,MAAM,CAAE,CAAC;AAClH,OAAO,MAAM,oBAAoB,GAAU,CAAE,OAAO,CAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,EAAE,EAAE,CAAE,EAAE,MAAM,CAAE,CAAC"}
\ No newline at end of file
- Rebase and squash your commits into just one commit before you make a pull request:
git rebase -i HEAD~n
n = number of commits to go back.
\ No newline at end of file
{
"_args": [
[
{
"raw": "angular2-logger@^0.3.0",
"scope": null,
"escapedName": "angular2-logger",
"name": "angular2-logger",
"rawSpec": "^0.3.0",
"spec": ">=0.3.0 <0.4.0",
"type": "range"
},
"/Users/liuzheng/gitproject/Jumpserver/Bifrost"
]
],
"_cnpm_publish_time": 1462417387136,
"_from": "angular2-logger@>=0.3.0 <0.4.0",
"_id": "angular2-logger@0.3.0",
"_inCache": true,
"_installable": true,
"_location": "/angular2-logger",
"_nodeVersion": "5.8.0",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/angular2-logger-0.3.0.tgz_1462417384745_0.6831560465507209"
},
"_npmUser": {
"name": "langley",
"email": "langley.agm@gmail.com"
},
"_npmVersion": "3.8.2",
"_phantomChildren": {},
"_requested": {
"raw": "angular2-logger@^0.3.0",
"scope": null,
"escapedName": "angular2-logger",
"name": "angular2-logger",
"rawSpec": "^0.3.0",
"spec": ">=0.3.0 <0.4.0",
"type": "range"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/angular2-logger/-/angular2-logger-0.3.0.tgz",
"_shasum": "9985569d40c814e7ba0ac9f9fd7e6b1e8fd082ea",
"_shrinkwrap": null,
"_spec": "angular2-logger@^0.3.0",
"_where": "/Users/liuzheng/gitproject/Jumpserver/Bifrost",
"author": {
"name": "Armando Garcia Moran"
},
"bugs": {
"url": "https://github.com/code-chunks/angular2-logger/issues"
},
"contributors": [
{
"name": "Armando Garcia",
"email": "langley.agm@gmail.com"
},
{
"name": "Juan Hernandez",
"email": "juanhersan@gmail.com"
}
],
"dependencies": {},
"description": "A Log4j inspired Logger for Angular 2.",
"devDependencies": {
"@angular/common": "^2.0.0-rc.1",
"@angular/compiler": "^2.0.0-rc.1",
"@angular/core": "^2.0.0-rc.1",
"@angular/platform-browser": "^2.0.0-rc.1",
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
"es6-promise": "^3.0.2",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rimraf": "^2.5.2",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.27",
"tslint": "^3.8.1",
"typescript": "^1.8.9",
"typings": "^0.8.1",
"uglify-js": "^2.6.2",
"zone.js": "^0.6.12"
},
"directories": {},
"dist": {
"shasum": "9985569d40c814e7ba0ac9f9fd7e6b1e8fd082ea",
"size": 13032,
"noattachment": false,
"tarball": "http://registry.npm.taobao.org/angular2-logger/download/angular2-logger-0.3.0.tgz"
},
"gitHead": "22cf159fa43f1007ad90399594b84660b59bf1fc",
"homepage": "https://github.com/code-chunks/angular2-logger#readme",
"keywords": [
"log",
"angular2",
"logger",
"angular 2",
"angular2-logger",
"console",
"ng2",
"logging",
"logmanager",
"log manager",
"debug",
"trace",
"error",
"info",
"warn",
"warning",
"fatal",
"log4j",
"log4ng",
"log4js",
"typescript",
"ng",
"angular"
],
"license": "MIT",
"main": "logger.js",
"maintainers": [
{
"name": "langley",
"email": "langley.agm@gmail.com"
},
{
"name": "mech543",
"email": "juanhersan@gmail.com"
}
],
"name": "angular2-logger",
"optionalDependencies": {},
"peerDependencies": {
"@angular/common": "^2.0.0-rc.1",
"@angular/compiler": "^2.0.0-rc.1",
"@angular/core": "^2.0.0-rc.1",
"@angular/platform-browser": "^2.0.0-rc.1",
"@angular/platform-browser-dynamic": "^2.0.0-rc.1"
},
"publish_time": 1462417387136,
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/code-chunks/angular2-logger.git"
},
"scripts": {
"build": "npm run minify",
"clean": "rimraf *.js *.js.map *.d.ts app/**/*.js app/**/*.js.map app/**/*.d.ts dist bundles",
"compile": "npm run compile:bundle && npm run compile:cjs && npm run compile:es6",
"compile:bundle": "tsc",
"compile:cjs": "tsc -t ES5 --sourceMap --experimentalDecorators --emitDecoratorMetadata --moduleResolution node --declaration core.ts typings/browser",
"compile:es6": "tsc -t ES6 --sourceMap --experimentalDecorators --emitDecoratorMetadata --moduleResolution node core.ts --outDir dist/es6",
"lint": "npm run tslint",
"minify": "uglifyjs -o bundles/angular2-logger.min.js bundles/angular2-logger.js",
"postbuild": "echo Build Successful.",
"prebuild": "npm run clean && npm run compile && npm run test",
"precompile": "typings install",
"prepublish": "npm run build",
"pretest": "npm run lint",
"test": "echo tests pending...",
"tsc": "tsc",
"tslint": "tslint *.ts src/**/*.ts",
"typings": "typings",
"uglifyjs": "uglifyjs"
},
"version": "0.3.0"
}
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export * from './src/pipes';
export * from './src/directives';
export * from './src/forms-deprecated';
export * from './src/common_directives';
export * from './src/location';
export { NgLocalization } from './src/localization';
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export * from './src/pipes';
export * from './src/directives';
export * from './src/forms-deprecated';
export * from './src/common_directives';
export * from './src/location';
export { NgLocalization } from './src/localization';
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../modules/@angular/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,SAAQ,cAAc,QAAO,oBAAoB,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './src/pipes';\nexport * from './src/directives';\nexport * from './src/forms-deprecated';\nexport * from './src/common_directives';\nexport * from './src/location';\nexport {NgLocalization} from './src/localization';\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Type } from '@angular/core';
/**
* A collection of Angular core directives that are likely to be used in each and every Angular
* application. This includes core directives (e.g., NgIf and NgFor), and forms directives (e.g.,
* NgModel).
*
* This collection can be used to quickly enumerate all the built-in directives in the `directives`
* property of the `@Component` decorator.
*
* ### Example
*
* Instead of writing:
*
* ```typescript
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm} from
* '@angular/common';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm,
* OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
* one could import all the common directives at once:
*
* ```typescript
* import {COMMON_DIRECTIVES} from '@angular/common';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [COMMON_DIRECTIVES, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
*
* @experimental Contains forms which are experimental.
*/
export declare const COMMON_DIRECTIVES: Type[][];
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { CORE_DIRECTIVES } from './directives';
import { FORM_DIRECTIVES } from './forms-deprecated';
/**
* A collection of Angular core directives that are likely to be used in each and every Angular
* application. This includes core directives (e.g., NgIf and NgFor), and forms directives (e.g.,
* NgModel).
*
* This collection can be used to quickly enumerate all the built-in directives in the `directives`
* property of the `@Component` decorator.
*
* ### Example
*
* Instead of writing:
*
* ```typescript
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm} from
* '@angular/common';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm,
* OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
* one could import all the common directives at once:
*
* ```typescript
* import {COMMON_DIRECTIVES} from '@angular/common';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [COMMON_DIRECTIVES, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
*
* @experimental Contains forms which are experimental.
*/
export const COMMON_DIRECTIVES = [CORE_DIRECTIVES, FORM_DIRECTIVES];
//# sourceMappingURL=common_directives.js.map
\ No newline at end of file
{"version":3,"file":"common_directives.js","sourceRoot":"","sources":["../../../../../modules/@angular/common/src/common_directives.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAII,EAAC,eAAe,EAAC,MAAM,cAAc;OACrC,EAAC,eAAe,EAAC,MAAM,oBAAoB;AAGlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,MAAM,iBAAiB,GAA+B,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '@angular/core';\n\nimport {CORE_DIRECTIVES} from './directives';\nimport {FORM_DIRECTIVES} from './forms-deprecated';\n\n\n/**\n * A collection of Angular core directives that are likely to be used in each and every Angular\n * application. This includes core directives (e.g., NgIf and NgFor), and forms directives (e.g.,\n * NgModel).\n *\n * This collection can be used to quickly enumerate all the built-in directives in the `directives`\n * property of the `@Component` decorator.\n *\n * ### Example\n *\n * Instead of writing:\n *\n * ```typescript\n * import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm} from\n * '@angular/common';\n * import {OtherDirective} from './myDirectives';\n *\n * @Component({\n * selector: 'my-component',\n * templateUrl: 'myComponent.html',\n * directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm,\n * OtherDirective]\n * })\n * export class MyComponent {\n * ...\n * }\n * ```\n * one could import all the common directives at once:\n *\n * ```typescript\n * import {COMMON_DIRECTIVES} from '@angular/common';\n * import {OtherDirective} from './myDirectives';\n *\n * @Component({\n * selector: 'my-component',\n * templateUrl: 'myComponent.html',\n * directives: [COMMON_DIRECTIVES, OtherDirective]\n * })\n * export class MyComponent {\n * ...\n * }\n * ```\n *\n * @experimental Contains forms which are experimental.\n */\nexport const COMMON_DIRECTIVES: Type[][] = /*@ts2dart_const*/[CORE_DIRECTIVES, FORM_DIRECTIVES];\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
{"__symbolic":"module","version":1,"metadata":{"COMMON_DIRECTIVES":[{"__symbolic":"reference","module":"./directives","name":"CORE_DIRECTIVES"},{"__symbolic":"reference","module":"./forms-deprecated","name":"FORM_DIRECTIVES"}]}}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @module
* @description
* Common directives shipped with Angular.
*/
export { CORE_DIRECTIVES } from './directives/core_directives';
export { NgClass } from './directives/ng_class';
export { NgFor } from './directives/ng_for';
export { NgIf } from './directives/ng_if';
export { NgPlural, NgPluralCase } from './directives/ng_plural';
export { NgStyle } from './directives/ng_style';
export { NgSwitch, NgSwitchCase, NgSwitchDefault } from './directives/ng_switch';
export { NgTemplateOutlet } from './directives/ng_template_outlet';
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @module
* @description
* Common directives shipped with Angular.
*/
export { CORE_DIRECTIVES } from './directives/core_directives';
export { NgClass } from './directives/ng_class';
export { NgFor } from './directives/ng_for';
export { NgIf } from './directives/ng_if';
export { NgPlural, NgPluralCase } from './directives/ng_plural';
export { NgStyle } from './directives/ng_style';
export { NgSwitch, NgSwitchCase, NgSwitchDefault } from './directives/ng_switch';
export { NgTemplateOutlet } from './directives/ng_template_outlet';
//# sourceMappingURL=directives.js.map
\ No newline at end of file
{"version":3,"file":"directives.js","sourceRoot":"","sources":["../../../../../modules/@angular/common/src/directives.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,SAAQ,eAAe,QAAO,8BAA8B,CAAC;AAC7D,SAAQ,OAAO,QAAO,uBAAuB,CAAC;AAC9C,SAAQ,KAAK,QAAO,qBAAqB,CAAC;AAC1C,SAAQ,IAAI,QAAO,oBAAoB,CAAC;AACxC,SAAQ,QAAQ,EAAE,YAAY,QAAO,wBAAwB,CAAC;AAC9D,SAAQ,OAAO,QAAO,uBAAuB,CAAC;AAC9C,SAAQ,QAAQ,EAAE,YAAY,EAAE,eAAe,QAAO,wBAAwB,CAAC;AAC/E,SAAQ,gBAAgB,QAAO,iCAAiC,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Common directives shipped with Angular.\n */\nexport {CORE_DIRECTIVES} from './directives/core_directives';\nexport {NgClass} from './directives/ng_class';\nexport {NgFor} from './directives/ng_for';\nexport {NgIf} from './directives/ng_if';\nexport {NgPlural, NgPluralCase} from './directives/ng_plural';\nexport {NgStyle} from './directives/ng_style';\nexport {NgSwitch, NgSwitchCase, NgSwitchDefault} from './directives/ng_switch';\nexport {NgTemplateOutlet} from './directives/ng_template_outlet';\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Type } from '../facade/lang';
/**
* A collection of Angular core directives that are likely to be used in each and every Angular
* application.
*
* This collection can be used to quickly enumerate all the built-in directives in the `directives`
* property of the `@Component` annotation.
*
* ### Example ([live demo](http://plnkr.co/edit/yakGwpCdUkg0qfzX5m8g?p=preview))
*
* Instead of writing:
*
* ```typescript
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from '@angular/common';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
* one could import all the core directives at once:
*
* ```typescript
* import {CORE_DIRECTIVES} from '@angular/common';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [CORE_DIRECTIVES, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
*
* @stable
*/
export declare const CORE_DIRECTIVES: Type[];
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { NgClass } from './ng_class';
import { NgFor } from './ng_for';
import { NgIf } from './ng_if';
import { NgPlural, NgPluralCase } from './ng_plural';
import { NgStyle } from './ng_style';
import { NgSwitch, NgSwitchCase, NgSwitchDefault } from './ng_switch';
import { NgTemplateOutlet } from './ng_template_outlet';
/**
* A collection of Angular core directives that are likely to be used in each and every Angular
* application.
*
* This collection can be used to quickly enumerate all the built-in directives in the `directives`
* property of the `@Component` annotation.
*
* ### Example ([live demo](http://plnkr.co/edit/yakGwpCdUkg0qfzX5m8g?p=preview))
*
* Instead of writing:
*
* ```typescript
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from '@angular/common';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
* one could import all the core directives at once:
*
* ```typescript
* import {CORE_DIRECTIVES} from '@angular/common';
* import {OtherDirective} from './myDirectives';
*
* @Component({
* selector: 'my-component',
* templateUrl: 'myComponent.html',
* directives: [CORE_DIRECTIVES, OtherDirective]
* })
* export class MyComponent {
* ...
* }
* ```
*
* @stable
*/
export const CORE_DIRECTIVES = [
NgClass,
NgFor,
NgIf,
NgTemplateOutlet,
NgStyle,
NgSwitch,
NgSwitchCase,
NgSwitchDefault,
NgPlural,
NgPluralCase,
];
//# sourceMappingURL=core_directives.js.map
\ No newline at end of file
{"version":3,"file":"core_directives.js","sourceRoot":"","sources":["../../../../../../modules/@angular/common/src/directives/core_directives.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAII,EAAC,OAAO,EAAC,MAAM,YAAY;OAC3B,EAAC,KAAK,EAAC,MAAM,UAAU;OACvB,EAAC,IAAI,EAAC,MAAM,SAAS;OACrB,EAAC,QAAQ,EAAE,YAAY,EAAC,MAAM,aAAa;OAC3C,EAAC,OAAO,EAAC,MAAM,YAAY;OAC3B,EAAC,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAC,MAAM,aAAa;OAC5D,EAAC,gBAAgB,EAAC,MAAM,sBAAsB;AAIrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,MAAM,eAAe,GAA6B;IACvD,OAAO;IACP,KAAK;IACL,IAAI;IACJ,gBAAgB;IAChB,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,eAAe;IACf,QAAQ;IACR,YAAY;CACb,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../facade/lang';\n\nimport {NgClass} from './ng_class';\nimport {NgFor} from './ng_for';\nimport {NgIf} from './ng_if';\nimport {NgPlural, NgPluralCase} from './ng_plural';\nimport {NgStyle} from './ng_style';\nimport {NgSwitch, NgSwitchCase, NgSwitchDefault} from './ng_switch';\nimport {NgTemplateOutlet} from './ng_template_outlet';\n\n\n\n/**\n * A collection of Angular core directives that are likely to be used in each and every Angular\n * application.\n *\n * This collection can be used to quickly enumerate all the built-in directives in the `directives`\n * property of the `@Component` annotation.\n *\n * ### Example ([live demo](http://plnkr.co/edit/yakGwpCdUkg0qfzX5m8g?p=preview))\n *\n * Instead of writing:\n *\n * ```typescript\n * import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from '@angular/common';\n * import {OtherDirective} from './myDirectives';\n *\n * @Component({\n * selector: 'my-component',\n * templateUrl: 'myComponent.html',\n * directives: [NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, OtherDirective]\n * })\n * export class MyComponent {\n * ...\n * }\n * ```\n * one could import all the core directives at once:\n *\n * ```typescript\n * import {CORE_DIRECTIVES} from '@angular/common';\n * import {OtherDirective} from './myDirectives';\n *\n * @Component({\n * selector: 'my-component',\n * templateUrl: 'myComponent.html',\n * directives: [CORE_DIRECTIVES, OtherDirective]\n * })\n * export class MyComponent {\n * ...\n * }\n * ```\n *\n * @stable\n */\nexport const CORE_DIRECTIVES: Type[] = /*@ts2dart_const*/[\n NgClass,\n NgFor,\n NgIf,\n NgTemplateOutlet,\n NgStyle,\n NgSwitch,\n NgSwitchCase,\n NgSwitchDefault,\n NgPlural,\n NgPluralCase,\n];\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
{"__symbolic":"module","version":1,"metadata":{"CORE_DIRECTIVES":[{"__symbolic":"reference","module":"./ng_class","name":"NgClass"},{"__symbolic":"reference","module":"./ng_for","name":"NgFor"},{"__symbolic":"reference","module":"./ng_if","name":"NgIf"},{"__symbolic":"reference","module":"./ng_template_outlet","name":"NgTemplateOutlet"},{"__symbolic":"reference","module":"./ng_style","name":"NgStyle"},{"__symbolic":"reference","module":"./ng_switch","name":"NgSwitch"},{"__symbolic":"reference","module":"./ng_switch","name":"NgSwitchCase"},{"__symbolic":"reference","module":"./ng_switch","name":"NgSwitchDefault"},{"__symbolic":"reference","module":"./ng_plural","name":"NgPlural"},{"__symbolic":"reference","module":"./ng_plural","name":"NgPluralCase"}]}}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { DoCheck, ElementRef, IterableDiffers, KeyValueDiffers, OnDestroy, Renderer } from '@angular/core';
/**
* The `NgClass` directive conditionally adds and removes CSS classes on an HTML element based on
* an expression's evaluation result.
*
* The result of an expression evaluation is interpreted differently depending on type of
* the expression evaluation result:
* - `string` - all the CSS classes listed in a string (space delimited) are added
* - `Array` - all the CSS classes (Array elements) are added
* - `Object` - each key corresponds to a CSS class name while values are interpreted as expressions
* evaluating to `Boolean`. If a given expression evaluates to `true` a corresponding CSS class
* is added - otherwise it is removed.
*
* While the `NgClass` directive can interpret expressions evaluating to `string`, `Array`
* or `Object`, the `Object`-based version is the most often used and has an advantage of keeping
* all the CSS class names in a template.
*
* ### Example ([live demo](http://plnkr.co/edit/a4YdtmWywhJ33uqfpPPn?p=preview)):
*
* ```
* import {Component} from '@angular/core';
* import {NgClass} from '@angular/common';
*
* @Component({
* selector: 'toggle-button',
* inputs: ['isDisabled'],
* template: `
* <div class="button" [ngClass]="{active: isOn, disabled: isDisabled}"
* (click)="toggle(!isOn)">
* Click me!
* </div>`,
* styles: [`
* .button {
* width: 120px;
* border: medium solid black;
* }
*
* .active {
* background-color: red;
* }
*
* .disabled {
* color: gray;
* border: medium solid gray;
* }
* `],
* directives: [NgClass]
* })
* class ToggleButton {
* isOn = false;
* isDisabled = false;
*
* toggle(newState) {
* if (!this.isDisabled) {
* this.isOn = newState;
* }
* }
* }
* ```
*
* @stable
*/
export declare class NgClass implements DoCheck, OnDestroy {
private _iterableDiffers;
private _keyValueDiffers;
private _ngEl;
private _renderer;
private _iterableDiffer;
private _keyValueDiffer;
private _initialClasses;
private _rawClass;
constructor(_iterableDiffers: IterableDiffers, _keyValueDiffers: KeyValueDiffers, _ngEl: ElementRef, _renderer: Renderer);
initialClasses: string;
rawClass: string | string[] | Set<string> | {
[key: string]: any;
};
ngDoCheck(): void;
ngOnDestroy(): void;
private _cleanupClasses(rawClassVal);
private _applyKeyValueChanges(changes);
private _applyIterableChanges(changes);
private _applyInitialClasses(isCleanup);
private _applyClasses(rawClassVal, isCleanup);
private _toggleClass(className, enabled);
}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Directive, ElementRef, IterableDiffers, KeyValueDiffers, Renderer } from '@angular/core';
import { StringMapWrapper, isListLikeIterable } from '../facade/collection';
import { isArray, isPresent, isString } from '../facade/lang';
export class NgClass {
constructor(_iterableDiffers, _keyValueDiffers, _ngEl, _renderer) {
this._iterableDiffers = _iterableDiffers;
this._keyValueDiffers = _keyValueDiffers;
this._ngEl = _ngEl;
this._renderer = _renderer;
this._initialClasses = [];
}
set initialClasses(v) {
this._applyInitialClasses(true);
this._initialClasses = isPresent(v) && isString(v) ? v.split(' ') : [];
this._applyInitialClasses(false);
this._applyClasses(this._rawClass, false);
}
set rawClass(v) {
this._cleanupClasses(this._rawClass);
if (isString(v)) {
v = v.split(' ');
}
this._rawClass = v;
this._iterableDiffer = null;
this._keyValueDiffer = null;
if (isPresent(v)) {
if (isListLikeIterable(v)) {
this._iterableDiffer = this._iterableDiffers.find(v).create(null);
}
else {
this._keyValueDiffer = this._keyValueDiffers.find(v).create(null);
}
}
}
ngDoCheck() {
if (isPresent(this._iterableDiffer)) {
var changes = this._iterableDiffer.diff(this._rawClass);
if (isPresent(changes)) {
this._applyIterableChanges(changes);
}
}
if (isPresent(this._keyValueDiffer)) {
var changes = this._keyValueDiffer.diff(this._rawClass);
if (isPresent(changes)) {
this._applyKeyValueChanges(changes);
}
}
}
ngOnDestroy() { this._cleanupClasses(this._rawClass); }
_cleanupClasses(rawClassVal) {
this._applyClasses(rawClassVal, true);
this._applyInitialClasses(false);
}
_applyKeyValueChanges(changes) {
changes.forEachAddedItem((record) => { this._toggleClass(record.key, record.currentValue); });
changes.forEachChangedItem((record) => { this._toggleClass(record.key, record.currentValue); });
changes.forEachRemovedItem((record) => {
if (record.previousValue) {
this._toggleClass(record.key, false);
}
});
}
_applyIterableChanges(changes) {
changes.forEachAddedItem((record) => { this._toggleClass(record.item, true); });
changes.forEachRemovedItem((record) => { this._toggleClass(record.item, false); });
}
_applyInitialClasses(isCleanup) {
this._initialClasses.forEach(className => this._toggleClass(className, !isCleanup));
}
_applyClasses(rawClassVal, isCleanup) {
if (isPresent(rawClassVal)) {
if (isArray(rawClassVal)) {
rawClassVal.forEach(className => this._toggleClass(className, !isCleanup));
}
else if (rawClassVal instanceof Set) {
rawClassVal.forEach(className => this._toggleClass(className, !isCleanup));
}
else {
StringMapWrapper.forEach(rawClassVal, (expVal, className) => {
if (isPresent(expVal))
this._toggleClass(className, !isCleanup);
});
}
}
}
_toggleClass(className, enabled) {
className = className.trim();
if (className.length > 0) {
if (className.indexOf(' ') > -1) {
var classes = className.split(/\s+/g);
for (var i = 0, len = classes.length; i < len; i++) {
this._renderer.setElementClass(this._ngEl.nativeElement, classes[i], enabled);
}
}
else {
this._renderer.setElementClass(this._ngEl.nativeElement, className, enabled);
}
}
}
}
/** @nocollapse */
NgClass.decorators = [
{ type: Directive, args: [{ selector: '[ngClass]', inputs: ['rawClass: ngClass', 'initialClasses: class'] },] },
];
/** @nocollapse */
NgClass.ctorParameters = [
{ type: IterableDiffers, },
{ type: KeyValueDiffers, },
{ type: ElementRef, },
{ type: Renderer, },
];
//# sourceMappingURL=ng_class.js.map
\ No newline at end of file
{"version":3,"file":"ng_class.js","sourceRoot":"","sources":["../../../../../../modules/@angular/common/src/directives/ng_class.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAEI,EAAyB,SAAS,EAAW,UAAU,EAAkB,eAAe,EAAwC,eAAe,EAAa,QAAQ,EAAC,MAAM,eAAe;OAE1L,EAAC,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB;OAClE,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,gBAAgB;AAC3D;IAME,YACY,gBAAiC,EAAU,gBAAiC,EAC5E,KAAiB,EAAU,SAAmB;QAD9C,qBAAgB,GAAhB,gBAAgB,CAAiB;QAAU,qBAAgB,GAAhB,gBAAgB,CAAiB;QAC5E,UAAK,GAAL,KAAK,CAAY;QAAU,cAAS,GAAT,SAAS,CAAU;QALlD,oBAAe,GAAa,EAAE,CAAC;IAKsB,CAAC;IAE9D,IAAI,cAAc,CAAC,CAAS;QAC1B,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACvE,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACjC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,IAAI,QAAQ,CAAC,CAAmD;QAC9D,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAErC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,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AC,GAAG,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;oBACnD,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;gBAChF,CAAC;YACH,CAAC;YAAC,IAAI,CAAC,CAAC;gBACN,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;YAC/E,CAAC;QACH,CAAC;IACH,CAAC;AAYH,CAAC;AAXD,kBAAkB;AACX,kBAAU,GAA0B;IAC3C,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,mBAAmB,EAAE,uBAAuB,CAAC,EAAC,EAAG,EAAE;CAC7G,CAAC;AACF,kBAAkB;AACX,sBAAc,GAA2D;IAChF,EAAC,IAAI,EAAE,eAAe,GAAG;IACzB,EAAC,IAAI,EAAE,eAAe,GAAG;IACzB,EAAC,IAAI,EAAE,UAAU,GAAG;IACpB,EAAC,IAAI,EAAE,QAAQ,GAAG;CACjB,CACA","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CollectionChangeRecord, Directive, DoCheck, ElementRef, IterableDiffer, IterableDiffers, KeyValueChangeRecord, KeyValueDiffer, KeyValueDiffers, OnDestroy, Renderer} from '@angular/core';\n\nimport {StringMapWrapper, isListLikeIterable} from '../facade/collection';\nimport {isArray, isPresent, isString} from '../facade/lang';\nexport class NgClass implements DoCheck, OnDestroy {\n private _iterableDiffer: IterableDiffer;\n private _keyValueDiffer: KeyValueDiffer;\n private _initialClasses: string[] = [];\n private _rawClass: string[]|Set<string>;\n\n constructor(\n private _iterableDiffers: IterableDiffers, private _keyValueDiffers: KeyValueDiffers,\n private _ngEl: ElementRef, private _renderer: Renderer) {}\n\n set initialClasses(v: string) {\n this._applyInitialClasses(true);\n this._initialClasses = isPresent(v) && isString(v) ? v.split(' ') : [];\n this._applyInitialClasses(false);\n this._applyClasses(this._rawClass, false);\n }\n\n set rawClass(v: string|string[]|Set<string>|{[key: string]: any}) {\n this._cleanupClasses(this._rawClass);\n\n if (isString(v)) {\n v = (<string>v).split(' ');\n }\n\n this._rawClass = <string[]|Set<string>>v;\n this._iterableDiffer = null;\n this._keyValueDiffer = null;\n if (isPresent(v)) {\n if (isListLikeIterable(v)) {\n this._iterableDiffer = this._iterableDiffers.find(v).create(null);\n } else {\n this._keyValueDiffer = this._keyValueDiffers.find(v).create(null);\n }\n }\n }\n\n ngDoCheck(): void {\n if (isPresent(this._iterableDiffer)) {\n var changes = this._iterableDiffer.diff(this._rawClass);\n if (isPresent(changes)) {\n this._applyIterableChanges(changes);\n }\n }\n if (isPresent(this._keyValueDiffer)) {\n var changes = this._keyValueDiffer.diff(this._rawClass);\n if (isPresent(changes)) {\n this._applyKeyValueChanges(changes);\n }\n }\n }\n\n ngOnDestroy(): void { this._cleanupClasses(this._rawClass); }\n\n private _cleanupClasses(rawClassVal: string[]|Set<string>|{[key: string]: any}): void {\n this._applyClasses(rawClassVal, true);\n this._applyInitialClasses(false);\n }\n\n private _applyKeyValueChanges(changes: any): void {\n changes.forEachAddedItem(\n (record: KeyValueChangeRecord) => { this._toggleClass(record.key, record.currentValue); });\n changes.forEachChangedItem(\n (record: KeyValueChangeRecord) => { this._toggleClass(record.key, record.currentValue); });\n changes.forEachRemovedItem((record: KeyValueChangeRecord) => {\n if (record.previousValue) {\n this._toggleClass(record.key, false);\n }\n });\n }\n\n private _applyIterableChanges(changes: any): void {\n changes.forEachAddedItem(\n (record: CollectionChangeRecord) => { this._toggleClass(record.item, true); });\n changes.forEachRemovedItem(\n (record: CollectionChangeRecord) => { this._toggleClass(record.item, false); });\n }\n\n private _applyInitialClasses(isCleanup: boolean) {\n this._initialClasses.forEach(className => this._toggleClass(className, !isCleanup));\n }\n\n private _applyClasses(\n rawClassVal: string[]|Set<string>|{[key: string]: any}, isCleanup: boolean) {\n if (isPresent(rawClassVal)) {\n if (isArray(rawClassVal)) {\n (<string[]>rawClassVal).forEach(className => this._toggleClass(className, !isCleanup));\n } else if (rawClassVal instanceof Set) {\n (<Set<string>>rawClassVal).forEach(className => this._toggleClass(className, !isCleanup));\n } else {\n StringMapWrapper.forEach(\n <{[k: string]: any}>rawClassVal, (expVal: any, className: string) => {\n if (isPresent(expVal)) this._toggleClass(className, !isCleanup);\n });\n }\n }\n }\n\n private _toggleClass(className: string, enabled: boolean): void {\n className = className.trim();\n if (className.length > 0) {\n if (className.indexOf(' ') > -1) {\n var classes = className.split(/\\s+/g);\n for (var i = 0, len = classes.length; i < len; i++) {\n this._renderer.setElementClass(this._ngEl.nativeElement, classes[i], enabled);\n }\n } else {\n this._renderer.setElementClass(this._ngEl.nativeElement, className, enabled);\n }\n }\n }\n/** @nocollapse */\nstatic decorators: DecoratorInvocation[] = [\n{ type: Directive, args: [{selector: '[ngClass]', inputs: ['rawClass: ngClass', 'initialClasses: class']}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: {type: Function, decorators?: DecoratorInvocation[]}[] = [\n{type: IterableDiffers, },\n{type: KeyValueDiffers, },\n{type: ElementRef, },\n{type: Renderer, },\n];\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
{"__symbolic":"module","version":1,"metadata":{"NgClass":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngClass]","inputs":["rawClass: ngClass","initialClasses: class"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"IterableDiffers"},{"__symbolic":"reference","module":"@angular/core","name":"KeyValueDiffers"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"}]}],"ngDoCheck":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"_cleanupClasses":[{"__symbolic":"method"}],"_applyKeyValueChanges":[{"__symbolic":"method"}],"_applyIterableChanges":[{"__symbolic":"method"}],"_applyInitialClasses":[{"__symbolic":"method"}],"_applyClasses":[{"__symbolic":"method"}],"_toggleClass":[{"__symbolic":"method"}]}}}}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ChangeDetectorRef, DoCheck, IterableDiffers, TemplateRef, TrackByFn, ViewContainerRef } from '@angular/core';
export declare class NgForRow {
$implicit: any;
index: number;
count: number;
constructor($implicit: any, index: number, count: number);
readonly first: boolean;
readonly last: boolean;
readonly even: boolean;
readonly odd: boolean;
}
/**
* The `NgFor` directive instantiates a template once per item from an iterable. The context for
* each instantiated template inherits from the outer context with the given loop variable set
* to the current item from the iterable.
*
* ### Local Variables
*
* `NgFor` provides several exported values that can be aliased to local variables:
*
* * `index` will be set to the current loop iteration for each template context.
* * `first` will be set to a boolean value indicating whether the item is the first one in the
* iteration.
* * `last` will be set to a boolean value indicating whether the item is the last one in the
* iteration.
* * `even` will be set to a boolean value indicating whether this item has an even index.
* * `odd` will be set to a boolean value indicating whether this item has an odd index.
*
* ### Change Propagation
*
* When the contents of the iterator changes, `NgFor` makes the corresponding changes to the DOM:
*
* * When an item is added, a new instance of the template is added to the DOM.
* * When an item is removed, its template instance is removed from the DOM.
* * When items are reordered, their respective templates are reordered in the DOM.
* * Otherwise, the DOM element for that item will remain the same.
*
* Angular uses object identity to track insertions and deletions within the iterator and reproduce
* those changes in the DOM. This has important implications for animations and any stateful
* controls
* (such as `<input>` elements which accept user input) that are present. Inserted rows can be
* animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state such
* as user input.
*
* It is possible for the identities of elements in the iterator to change while the data does not.
* This can happen, for example, if the iterator produced from an RPC to the server, and that
* RPC is re-run. Even if the data hasn't changed, the second response will produce objects with
* different identities, and Angular will tear down the entire DOM and rebuild it (as if all old
* elements were deleted and all new elements inserted). This is an expensive operation and should
* be avoided if possible.
*
* ### Syntax
*
* - `<li *ngFor="let item of items; let i = index">...</li>`
* - `<li template="ngFor let item of items; let i = index">...</li>`
* - `<template ngFor let-item [ngForOf]="items" let-i="index"><li>...</li></template>`
*
* ### Example
*
* See a [live demo](http://plnkr.co/edit/KVuXxDp0qinGDyo307QW?p=preview) for a more detailed
* example.
*
* @stable
*/
export declare class NgFor implements DoCheck {
private _viewContainer;
private _templateRef;
private _iterableDiffers;
private _cdr;
private _differ;
constructor(_viewContainer: ViewContainerRef, _templateRef: TemplateRef<NgForRow>, _iterableDiffers: IterableDiffers, _cdr: ChangeDetectorRef);
ngForOf: any;
ngForTemplate: TemplateRef<NgForRow>;
ngForTrackBy: TrackByFn;
ngDoCheck(): void;
private _applyChanges(changes);
private _perViewChange(view, record);
private _bulkRemove(tuples);
private _bulkInsert(tuples);
}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ChangeDetectorRef, Directive, IterableDiffers, TemplateRef, ViewContainerRef } from '@angular/core';
import { BaseException } from '../facade/exceptions';
import { getTypeNameForDebugging, isBlank, isPresent } from '../facade/lang';
export class NgForRow {
constructor($implicit, index, count) {
this.$implicit = $implicit;
this.index = index;
this.count = count;
}
get first() { return this.index === 0; }
get last() { return this.index === this.count - 1; }
get even() { return this.index % 2 === 0; }
get odd() { return !this.even; }
}
export class NgFor {
constructor(_viewContainer, _templateRef, _iterableDiffers, _cdr) {
this._viewContainer = _viewContainer;
this._templateRef = _templateRef;
this._iterableDiffers = _iterableDiffers;
this._cdr = _cdr;
}
set ngForOf(value) {
this._ngForOf = value;
if (isBlank(this._differ) && isPresent(value)) {
try {
this._differ = this._iterableDiffers.find(value).create(this._cdr, this._ngForTrackBy);
}
catch (e) {
throw new BaseException(`Cannot find a differ supporting object '${value}' of type '${getTypeNameForDebugging(value)}'. NgFor only supports binding to Iterables such as Arrays.`);
}
}
}
set ngForTemplate(value) {
if (isPresent(value)) {
this._templateRef = value;
}
}
set ngForTrackBy(value) { this._ngForTrackBy = value; }
ngDoCheck() {
if (isPresent(this._differ)) {
var changes = this._differ.diff(this._ngForOf);
if (isPresent(changes))
this._applyChanges(changes);
}
}
_applyChanges(changes) {
// TODO(rado): check if change detection can produce a change record that is
// easier to consume than current.
var recordViewTuples = [];
changes.forEachRemovedItem((removedRecord) => recordViewTuples.push(new RecordViewTuple(removedRecord, null)));
changes.forEachMovedItem((movedRecord) => recordViewTuples.push(new RecordViewTuple(movedRecord, null)));
var insertTuples = this._bulkRemove(recordViewTuples);
changes.forEachAddedItem((addedRecord) => insertTuples.push(new RecordViewTuple(addedRecord, null)));
this._bulkInsert(insertTuples);
for (var i = 0; i < insertTuples.length; i++) {
this._perViewChange(insertTuples[i].view, insertTuples[i].record);
}
for (var i = 0, ilen = this._viewContainer.length; i < ilen; i++) {
var viewRef = this._viewContainer.get(i);
viewRef.context.index = i;
viewRef.context.count = ilen;
}
changes.forEachIdentityChange((record /** TODO #9100 */) => {
var viewRef = this._viewContainer.get(record.currentIndex);
viewRef.context.$implicit = record.item;
});
}
_perViewChange(view, record) {
view.context.$implicit = record.item;
}
_bulkRemove(tuples) {
tuples.sort((a, b) => a.record.previousIndex - b.record.previousIndex);
var movedTuples = [];
for (var i = tuples.length - 1; i >= 0; i--) {
var tuple = tuples[i];
// separate moved views from removed views.
if (isPresent(tuple.record.currentIndex)) {
tuple.view =
this._viewContainer.detach(tuple.record.previousIndex);
movedTuples.push(tuple);
}
else {
this._viewContainer.remove(tuple.record.previousIndex);
}
}
return movedTuples;
}
_bulkInsert(tuples) {
tuples.sort((a, b) => a.record.currentIndex - b.record.currentIndex);
for (var i = 0; i < tuples.length; i++) {
var tuple = tuples[i];
if (isPresent(tuple.view)) {
this._viewContainer.insert(tuple.view, tuple.record.currentIndex);
}
else {
tuple.view = this._viewContainer.createEmbeddedView(this._templateRef, new NgForRow(null, null, null), tuple.record.currentIndex);
}
}
return tuples;
}
}
/** @nocollapse */
NgFor.decorators = [
{ type: Directive, args: [{ selector: '[ngFor][ngForOf]', inputs: ['ngForTrackBy', 'ngForOf', 'ngForTemplate'] },] },
];
/** @nocollapse */
NgFor.ctorParameters = [
{ type: ViewContainerRef, },
{ type: TemplateRef, },
{ type: IterableDiffers, },
{ type: ChangeDetectorRef, },
];
class RecordViewTuple {
constructor(record, view) {
this.record = record;
this.view = view;
}
}
//# sourceMappingURL=ng_for.js.map
\ No newline at end of file
This diff is collapsed.
{"__symbolic":"module","version":1,"metadata":{"NgFor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngFor][ngForOf]","inputs":["ngForTrackBy","ngForOf","ngForTemplate"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"NgForRow"}]},{"__symbolic":"reference","module":"@angular/core","name":"IterableDiffers"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"ngDoCheck":[{"__symbolic":"method"}],"_applyChanges":[{"__symbolic":"method"}],"_perViewChange":[{"__symbolic":"method"}],"_bulkRemove":[{"__symbolic":"method"}],"_bulkInsert":[{"__symbolic":"method"}]}}}}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { TemplateRef, ViewContainerRef } from '@angular/core';
/**
* Removes or recreates a portion of the DOM tree based on an {expression}.
*
* If the expression assigned to `ngIf` evaluates to a false value then the element
* is removed from the DOM, otherwise a clone of the element is reinserted into the DOM.
*
* ### Example ([live demo](http://plnkr.co/edit/fe0kgemFBtmQOY31b4tw?p=preview)):
*
* ```
* <div *ngIf="errorCount > 0" class="error">
* <!-- Error message displayed when the errorCount property on the current context is greater
* than 0. -->
* {{errorCount}} errors detected
* </div>
* ```
*
* ### Syntax
*
* - `<div *ngIf="condition">...</div>`
* - `<div template="ngIf condition">...</div>`
* - `<template [ngIf]="condition"><div>...</div></template>`
*
* @stable
*/
export declare class NgIf {
private _viewContainer;
private _templateRef;
private _prevCondition;
constructor(_viewContainer: ViewContainerRef, _templateRef: TemplateRef<Object>);
ngIf: any;
}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Directive, TemplateRef, ViewContainerRef } from '@angular/core';
import { isBlank } from '../facade/lang';
export class NgIf {
constructor(_viewContainer, _templateRef) {
this._viewContainer = _viewContainer;
this._templateRef = _templateRef;
this._prevCondition = null;
}
set ngIf(newCondition /* boolean */) {
if (newCondition && (isBlank(this._prevCondition) || !this._prevCondition)) {
this._prevCondition = true;
this._viewContainer.createEmbeddedView(this._templateRef);
}
else if (!newCondition && (isBlank(this._prevCondition) || this._prevCondition)) {
this._prevCondition = false;
this._viewContainer.clear();
}
}
}
/** @nocollapse */
NgIf.decorators = [
{ type: Directive, args: [{ selector: '[ngIf]', inputs: ['ngIf'] },] },
];
/** @nocollapse */
NgIf.ctorParameters = [
{ type: ViewContainerRef, },
{ type: TemplateRef, },
];
//# sourceMappingURL=ng_if.js.map
\ No newline at end of file
{"version":3,"file":"ng_if.js","sourceRoot":"","sources":["../../../../../../modules/@angular/common/src/directives/ng_if.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAEI,EAAC,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe;OAE/D,EAAC,OAAO,EAAC,MAAM,gBAAgB;AACtC;IAGE,YAAoB,cAAgC,EAAU,YAAiC;QAA3E,mBAAc,GAAd,cAAc,CAAkB;QAAU,iBAAY,GAAZ,YAAY,CAAqB;QAFvF,mBAAc,GAAY,IAAI,CAAC;IAGvC,CAAC;IAED,IAAI,IAAI,CAAC,YAAiB,CAAC,aAAa;QACtC,EAAE,CAAC,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;YAC3E,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;YAC3B,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC5D,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;YAClF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;YAC5B,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC9B,CAAC;IACH,CAAC;AAUH,CAAC;AATD,kBAAkB;AACX,eAAU,GAA0B;IAC3C,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAC,EAAG,EAAE;CACpE,CAAC;AACF,kBAAkB;AACX,mBAAc,GAA2D;IAChF,EAAC,IAAI,EAAE,gBAAgB,GAAG;IAC1B,EAAC,IAAI,EAAE,WAAW,GAAG;CACpB,CACA","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, TemplateRef, ViewContainerRef} from '@angular/core';\n\nimport {isBlank} from '../facade/lang';\nexport class NgIf {\n private _prevCondition: boolean = null;\n\n constructor(private _viewContainer: ViewContainerRef, private _templateRef: TemplateRef<Object>) {\n }\n\n set ngIf(newCondition: any /* boolean */) {\n if (newCondition && (isBlank(this._prevCondition) || !this._prevCondition)) {\n this._prevCondition = true;\n this._viewContainer.createEmbeddedView(this._templateRef);\n } else if (!newCondition && (isBlank(this._prevCondition) || this._prevCondition)) {\n this._prevCondition = false;\n this._viewContainer.clear();\n }\n }\n/** @nocollapse */\nstatic decorators: DecoratorInvocation[] = [\n{ type: Directive, args: [{selector: '[ngIf]', inputs: ['ngIf']}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: {type: Function, decorators?: DecoratorInvocation[]}[] = [\n{type: ViewContainerRef, },\n{type: TemplateRef, },\n];\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
{"__symbolic":"module","version":1,"metadata":{"NgIf":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngIf]","inputs":["ngIf"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"Object"}]}]}]}}}}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { AfterContentInit, QueryList, TemplateRef, ViewContainerRef } from '@angular/core';
import { NgLocalization } from '../localization';
/**
* `ngPlural` is an i18n directive that displays DOM sub-trees that match the switch expression
* value, or failing that, DOM sub-trees that match the switch expression's pluralization category.
*
* To use this directive, you must provide an extension of `NgLocalization` that maps values to
* category names. You then define a container element that sets the `[ngPlural]` attribute to a
* switch expression.
* - Inner elements defined with an `[ngPluralCase]` attribute will display based on their
* expression.
* - If `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value
* matches the switch expression exactly.
* - Otherwise, the view will be treated as a "category match", and will only display if exact
* value matches aren't found and the value maps to its category using the `getPluralCategory`
* function provided.
*
* ```typescript
* class MyLocalization extends NgLocalization {
* getPluralCategory(value: any) {
* if(value < 5) {
* return 'few';
* }
* }
* }
*
* @Component({
* selector: 'app',
* providers: [{provide: NgLocalization, useClass: MyLocalization}]
* })
* @View({
* template: `
* <p>Value = {{value}}</p>
* <button (click)="inc()">Increment</button>
*
* <div [ngPlural]="value">
* <template ngPluralCase="=0">there is nothing</template>
* <template ngPluralCase="=1">there is one</template>
* <template ngPluralCase="few">there are a few</template>
* <template ngPluralCase="other">there is some number</template>
* </div>
* `,
* directives: [NgPlural, NgPluralCase]
* })
* export class App {
* value = 'init';
*
* inc() {
* this.value = this.value === 'init' ? 0 : this.value + 1;
* }
* }
*
* ```
* @experimental
*/
export declare class NgPluralCase {
value: string;
constructor(value: string, template: TemplateRef<Object>, viewContainer: ViewContainerRef);
}
/**
* @experimental
*/
export declare class NgPlural implements AfterContentInit {
private _localization;
private _switchValue;
private _activeView;
private _caseViews;
cases: QueryList<NgPluralCase>;
constructor(_localization: NgLocalization);
ngPlural: number;
ngAfterContentInit(): void;
}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Attribute, ContentChildren, Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';
import { isPresent } from '../facade/lang';
import { NgLocalization, getPluralCategory } from '../localization';
import { SwitchView } from './ng_switch';
export class NgPluralCase {
constructor(value, template, viewContainer) {
this.value = value;
this._view = new SwitchView(viewContainer, template);
}
}
/** @nocollapse */
NgPluralCase.decorators = [
{ type: Directive, args: [{ selector: '[ngPluralCase]' },] },
];
/** @nocollapse */
NgPluralCase.ctorParameters = [
{ type: undefined, decorators: [{ type: Attribute, args: ['ngPluralCase',] },] },
{ type: TemplateRef, },
{ type: ViewContainerRef, },
];
export class NgPlural {
constructor(_localization) {
this._localization = _localization;
this._caseViews = {};
this.cases = null;
}
set ngPlural(value) {
this._switchValue = value;
this._updateView();
}
ngAfterContentInit() {
this.cases.forEach((pluralCase) => {
this._caseViews[pluralCase.value] = pluralCase._view;
});
this._updateView();
}
/** @internal */
_updateView() {
this._clearViews();
var key = getPluralCategory(this._switchValue, Object.getOwnPropertyNames(this._caseViews), this._localization);
this._activateView(this._caseViews[key]);
}
/** @internal */
_clearViews() {
if (isPresent(this._activeView))
this._activeView.destroy();
}
/** @internal */
_activateView(view) {
if (!isPresent(view))
return;
this._activeView = view;
this._activeView.create();
}
}
/** @nocollapse */
NgPlural.decorators = [
{ type: Directive, args: [{ selector: '[ngPlural]' },] },
];
/** @nocollapse */
NgPlural.ctorParameters = [
{ type: NgLocalization, },
];
/** @nocollapse */
NgPlural.propDecorators = {
'cases': [{ type: ContentChildren, args: [NgPluralCase,] },],
'ngPlural': [{ type: Input },],
};
//# sourceMappingURL=ng_plural.js.map
\ No newline at end of file
{"version":3,"file":"ng_plural.js","sourceRoot":"","sources":["../../../../../../modules/@angular/common/src/directives/ng_plural.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAEI,EAAmB,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAa,WAAW,EAAE,gBAAgB,EAAC,MAAM,eAAe;OAC/H,EAAC,SAAS,EAAC,MAAM,gBAAgB;OACjC,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,iBAAiB;OAC1D,EAAC,UAAU,EAAC,MAAM,aAAa;AACtC;IAGE,YAAoB,KAAa,EAAE,QAA6B,EAC5D,aAA+B;QADf,UAAK,GAAL,KAAK,CAAQ;QAE/B,IAAI,CAAC,KAAK,GAAG,IAAI,UAAU,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACvD,CAAC;AAWH,CAAC;AAVD,kBAAkB;AACX,uBAAU,GAA0B;IAC3C,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,E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IAC9D,CAAC;IAED,gBAAgB;IAChB,aAAa,CAAC,IAAgB;QAC5B,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;AAcH,CAAC;AAbD,kBAAkB;AACX,mBAAU,GAA0B;IAC3C,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAC,QAAQ,EAAE,YAAY,EAAC,EAAG,EAAE;CACtD,CAAC;AACF,kBAAkB;AACX,uBAAc,GAA2D;IAChF,EAAC,IAAI,EAAE,cAAc,GAAG;CACvB,CAAC;AACF,kBAAkB;AACX,uBAAc,GAA2C;IAChE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,YAAY,EAAG,EAAE,EAAE;IAC7D,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;CAC7B,CACA","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AfterContentInit, Attribute, ContentChildren, Directive, Input, QueryList, TemplateRef, ViewContainerRef} from '@angular/core';\nimport {isPresent} from '../facade/lang';\nimport {NgLocalization, getPluralCategory} from '../localization';\nimport {SwitchView} from './ng_switch';\nexport class NgPluralCase {\n /** @internal */\n _view: SwitchView;\n constructor( public value: string, template: TemplateRef<Object>,\n viewContainer: ViewContainerRef) {\n this._view = new SwitchView(viewContainer, template);\n }\n/** @nocollapse */\nstatic decorators: DecoratorInvocation[] = [\n{ type: Directive, args: [{selector: '[ngPluralCase]'}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: {type: Function, decorators?: DecoratorInvocation[]}[] = [\n{type: undefined, decorators: [{ type: Attribute, args: ['ngPluralCase', ] }, ]},\n{type: TemplateRef, },\n{type: ViewContainerRef, },\n];\n}\nexport class NgPlural implements AfterContentInit {\n private _switchValue: number;\n private _activeView: SwitchView;\n private _caseViews: {[k: string]: SwitchView} = {}; cases: QueryList<NgPluralCase> = null;\n\n constructor(private _localization: NgLocalization) {}\n set ngPlural(value: number) {\n this._switchValue = value;\n this._updateView();\n }\n\n ngAfterContentInit() {\n this.cases.forEach((pluralCase: NgPluralCase): void => {\n this._caseViews[pluralCase.value] = pluralCase._view;\n });\n this._updateView();\n }\n\n /** @internal */\n _updateView(): void {\n this._clearViews();\n\n var key = getPluralCategory(\n this._switchValue, Object.getOwnPropertyNames(this._caseViews), this._localization);\n this._activateView(this._caseViews[key]);\n }\n\n /** @internal */\n _clearViews() {\n if (isPresent(this._activeView)) this._activeView.destroy();\n }\n\n /** @internal */\n _activateView(view: SwitchView) {\n if (!isPresent(view)) return;\n this._activeView = view;\n this._activeView.create();\n }\n/** @nocollapse */\nstatic decorators: DecoratorInvocation[] = [\n{ type: Directive, args: [{selector: '[ngPlural]'}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: {type: Function, decorators?: DecoratorInvocation[]}[] = [\n{type: NgLocalization, },\n];\n/** @nocollapse */\nstatic propDecorators: {[key: string]: DecoratorInvocation[]} = {\n'cases': [{ type: ContentChildren, args: [NgPluralCase, ] },],\n'ngPlural': [{ type: Input },],\n};\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
{"__symbolic":"module","version":1,"metadata":{"NgPluralCase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngPluralCase]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Attribute"},"arguments":["ngPluralCase"]}],null,null],"parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"Object"}]},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"}]}]}},"NgPlural":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngPlural]"}]}],"members":{"cases":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren"},"arguments":[{"__symbolic":"reference","name":"NgPluralCase"}]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../localization","name":"NgLocalization"}]}],"ngPlural":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngAfterContentInit":[{"__symbolic":"method"}],"_updateView":[{"__symbolic":"method"}],"_clearViews":[{"__symbolic":"method"}],"_activateView":[{"__symbolic":"method"}]}}}}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { DoCheck, ElementRef, KeyValueDiffers, Renderer } from '@angular/core';
/**
* The `NgStyle` directive changes styles based on a result of expression evaluation.
*
* An expression assigned to the `ngStyle` property must evaluate to an object and the
* corresponding element styles are updated based on changes to this object. Style names to update
* are taken from the object's keys, and values - from the corresponding object's values.
*
* ### Syntax
*
* - `<div [ngStyle]="{'font-style': style}"></div>`
* - `<div [ngStyle]="styleExp"></div>` - here the `styleExp` must evaluate to an object
*
* ### Example ([live demo](http://plnkr.co/edit/YamGS6GkUh9GqWNQhCyM?p=preview)):
*
* ```
* import {Component} from '@angular/core';
* import {NgStyle} from '@angular/common';
*
* @Component({
* selector: 'ngStyle-example',
* template: `
* <h1 [ngStyle]="{'font-style': style, 'font-size': size, 'font-weight': weight}">
* Change style of this text!
* </h1>
*
* <hr>
*
* <label>Italic: <input type="checkbox" (change)="changeStyle($event)"></label>
* <label>Bold: <input type="checkbox" (change)="changeWeight($event)"></label>
* <label>Size: <input type="text" [value]="size" (change)="size = $event.target.value"></label>
* `,
* directives: [NgStyle]
* })
* export class NgStyleExample {
* style = 'normal';
* weight = 'normal';
* size = '20px';
*
* changeStyle($event: any) {
* this.style = $event.target.checked ? 'italic' : 'normal';
* }
*
* changeWeight($event: any) {
* this.weight = $event.target.checked ? 'bold' : 'normal';
* }
* }
* ```
*
* In this example the `font-style`, `font-size` and `font-weight` styles will be updated
* based on the `style` property's value changes.
*
* @stable
*/
export declare class NgStyle implements DoCheck {
private _differs;
private _ngEl;
private _renderer;
constructor(_differs: KeyValueDiffers, _ngEl: ElementRef, _renderer: Renderer);
rawStyle: {
[key: string]: string;
};
ngDoCheck(): void;
private _applyChanges(changes);
private _setStyle(name, val);
}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Directive, ElementRef, KeyValueDiffers, Renderer } from '@angular/core';
import { isBlank, isPresent } from '../facade/lang';
export class NgStyle {
constructor(_differs, _ngEl, _renderer) {
this._differs = _differs;
this._ngEl = _ngEl;
this._renderer = _renderer;
}
set rawStyle(v) {
this._rawStyle = v;
if (isBlank(this._differ) && isPresent(v)) {
this._differ = this._differs.find(this._rawStyle).create(null);
}
}
ngDoCheck() {
if (isPresent(this._differ)) {
var changes = this._differ.diff(this._rawStyle);
if (isPresent(changes)) {
this._applyChanges(changes);
}
}
}
_applyChanges(changes) {
changes.forEachAddedItem((record) => { this._setStyle(record.key, record.currentValue); });
changes.forEachChangedItem((record) => { this._setStyle(record.key, record.currentValue); });
changes.forEachRemovedItem((record) => { this._setStyle(record.key, null); });
}
_setStyle(name, val) {
this._renderer.setElementStyle(this._ngEl.nativeElement, name, val);
}
}
/** @nocollapse */
NgStyle.decorators = [
{ type: Directive, args: [{ selector: '[ngStyle]', inputs: ['rawStyle: ngStyle'] },] },
];
/** @nocollapse */
NgStyle.ctorParameters = [
{ type: KeyValueDiffers, },
{ type: ElementRef, },
{ type: Renderer, },
];
//# sourceMappingURL=ng_style.js.map
\ No newline at end of file
{"version":3,"file":"ng_style.js","sourceRoot":"","sources":["../../../../../../modules/@angular/common/src/directives/ng_style.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAEI,EAAC,SAAS,EAAW,UAAU,EAAwC,eAAe,EAAE,QAAQ,EAAC,MAAM,eAAe;OAEtH,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB;AACjD;IAME,YACY,QAAyB,EAAU,KAAiB,EAAU,SAAmB;QAAjF,aAAQ,GAAR,QAAQ,CAAiB;QAAU,UAAK,GAAL,KAAK,CAAY;QAAU,cAAS,GAAT,SAAS,CAAU;IAAG,CAAC;IAEjG,IAAI,QAAQ,CAAC,CAA0B;QACrC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAED,SAAS;QACP,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAC5B,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAChD,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBACvB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IAEO,aAAa,CAAC,OAAY;QAChC,OAAO,CAAC,gBAAgB,CACpB,CAAC,MAA4B,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5F,OAAO,CAAC,kBAAkB,CACtB,CAAC,MAA4B,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5F,OAAO,CAAC,kBAAkB,CACtB,CAAC,MAA4B,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;IAEO,SAAS,CAAC,IAAY,EAAE,GAAW;QACzC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IACtE,CAAC;AAWH,CAAC;AAVD,kBAAkB;AACX,kBAAU,GAA0B;IAC3C,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,mBAAmB,CAAC,EAAC,EAAG,EAAE;CACpF,CAAC;AACF,kBAAkB;AACX,sBAAc,GAA2D;IAChF,EAAC,IAAI,EAAE,eAAe,GAAG;IACzB,EAAC,IAAI,EAAE,UAAU,GAAG;IACpB,EAAC,IAAI,EAAE,QAAQ,GAAG;CACjB,CACA","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, DoCheck, ElementRef, KeyValueChangeRecord, KeyValueDiffer, KeyValueDiffers, Renderer} from '@angular/core';\n\nimport {isBlank, isPresent} from '../facade/lang';\nexport class NgStyle implements DoCheck {\n /** @internal */\n _rawStyle: {[key: string]: string};\n /** @internal */\n _differ: KeyValueDiffer;\n\n constructor(\n private _differs: KeyValueDiffers, private _ngEl: ElementRef, private _renderer: Renderer) {}\n\n set rawStyle(v: {[key: string]: string}) {\n this._rawStyle = v;\n if (isBlank(this._differ) && isPresent(v)) {\n this._differ = this._differs.find(this._rawStyle).create(null);\n }\n }\n\n ngDoCheck() {\n if (isPresent(this._differ)) {\n var changes = this._differ.diff(this._rawStyle);\n if (isPresent(changes)) {\n this._applyChanges(changes);\n }\n }\n }\n\n private _applyChanges(changes: any): void {\n changes.forEachAddedItem(\n (record: KeyValueChangeRecord) => { this._setStyle(record.key, record.currentValue); });\n changes.forEachChangedItem(\n (record: KeyValueChangeRecord) => { this._setStyle(record.key, record.currentValue); });\n changes.forEachRemovedItem(\n (record: KeyValueChangeRecord) => { this._setStyle(record.key, null); });\n }\n\n private _setStyle(name: string, val: string): void {\n this._renderer.setElementStyle(this._ngEl.nativeElement, name, val);\n }\n/** @nocollapse */\nstatic decorators: DecoratorInvocation[] = [\n{ type: Directive, args: [{selector: '[ngStyle]', inputs: ['rawStyle: ngStyle']}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: {type: Function, decorators?: DecoratorInvocation[]}[] = [\n{type: KeyValueDiffers, },\n{type: ElementRef, },\n{type: Renderer, },\n];\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
{"__symbolic":"module","version":1,"metadata":{"NgStyle":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngStyle]","inputs":["rawStyle: ngStyle"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"KeyValueDiffers"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"}]}],"ngDoCheck":[{"__symbolic":"method"}],"_applyChanges":[{"__symbolic":"method"}],"_setStyle":[{"__symbolic":"method"}]}}}}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { TemplateRef, ViewContainerRef } from '@angular/core';
export declare class SwitchView {
private _viewContainerRef;
private _templateRef;
constructor(_viewContainerRef: ViewContainerRef, _templateRef: TemplateRef<Object>);
create(): void;
destroy(): void;
}
/**
* Adds or removes DOM sub-trees when their match expressions match the switch expression.
*
* Elements within `NgSwitch` but without `ngSwitchCase` or `NgSwitchDefault` directives will be
* preserved at the location as specified in the template.
*
* `NgSwitch` simply inserts nested elements based on which match expression matches the value
* obtained from the evaluated switch expression. In other words, you define a container element
* (where you place the directive with a switch expression on the
* `[ngSwitch]="..."` attribute), define any inner elements inside of the directive and
* place a `[ngSwitchCase]` attribute per element.
*
* The `ngSwitchCase` property is used to inform `NgSwitch` which element to display when the
* expression is evaluated. If a matching expression is not found via a `ngSwitchCase` property
* then an element with the `ngSwitchDefault` attribute is displayed.
*
* ### Example ([live demo](http://plnkr.co/edit/DQMTII95CbuqWrl3lYAs?p=preview))
*
* ```typescript
* @Component({
* selector: 'app',
* template: `
* <p>Value = {{value}}</p>
* <button (click)="inc()">Increment</button>
*
* <div [ngSwitch]="value">
* <p *ngSwitchCase="'init'">increment to start</p>
* <p *ngSwitchCase="0">0, increment again</p>
* <p *ngSwitchCase="1">1, increment again</p>
* <p *ngSwitchCase="2">2, stop incrementing</p>
* <p *ngSwitchDefault>&gt; 2, STOP!</p>
* </div>
*
* <!-- alternate syntax -->
*
* <p [ngSwitch]="value">
* <template ngSwitchCase="init">increment to start</template>
* <template [ngSwitchCase]="0">0, increment again</template>
* <template [ngSwitchCase]="1">1, increment again</template>
* <template [ngSwitchCase]="2">2, stop incrementing</template>
* <template ngSwitchDefault>&gt; 2, STOP!</template>
* </p>
* `,
* directives: [NgSwitch, ngSwitchCase, NgSwitchDefault]
* })
* export class App {
* value = 'init';
*
* inc() {
* this.value = this.value === 'init' ? 0 : this.value + 1;
* }
* }
*
* bootstrap(App).catch(err => console.error(err));
* ```
*
* @experimental
*/
export declare class NgSwitch {
private _switchValue;
private _useDefault;
private _valueViews;
private _activeViews;
ngSwitch: any;
}
/**
* Insert the sub-tree when the `ngSwitchCase` expression evaluates to the same value as the
* enclosing switch expression.
*
* If multiple match expression match the switch expression value, all of them are displayed.
*
* See {@link NgSwitch} for more details and example.
*
* @experimental
*/
export declare class NgSwitchCase {
private _switch;
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, ngSwitch: NgSwitch);
ngSwitchCase: any;
ngSwitchWhen: any;
}
/**
* Default case statements are displayed when no match expression matches the switch expression
* value.
*
* See {@link NgSwitch} for more details and example.
*
* @experimental
*/
export declare class NgSwitchDefault {
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, sswitch: NgSwitch);
}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Directive, Host, TemplateRef, ViewContainerRef } from '@angular/core';
import { ListWrapper, Map } from '../facade/collection';
import { isBlank, isPresent, normalizeBlank } from '../facade/lang';
const _CASE_DEFAULT = new Object();
// TODO: remove when fully deprecated
let _warned = false;
export class SwitchView {
constructor(_viewContainerRef, _templateRef) {
this._viewContainerRef = _viewContainerRef;
this._templateRef = _templateRef;
}
create() { this._viewContainerRef.createEmbeddedView(this._templateRef); }
destroy() { this._viewContainerRef.clear(); }
}
export class NgSwitch {
constructor() {
this._useDefault = false;
this._valueViews = new Map();
this._activeViews = [];
}
set ngSwitch(value) {
// Empty the currently active ViewContainers
this._emptyAllActiveViews();
// Add the ViewContainers matching the value (with a fallback to default)
this._useDefault = false;
var views = this._valueViews.get(value);
if (isBlank(views)) {
this._useDefault = true;
views = normalizeBlank(this._valueViews.get(_CASE_DEFAULT));
}
this._activateViews(views);
this._switchValue = value;
}
/** @internal */
_onCaseValueChanged(oldCase, newCase, view) {
this._deregisterView(oldCase, view);
this._registerView(newCase, view);
if (oldCase === this._switchValue) {
view.destroy();
ListWrapper.remove(this._activeViews, view);
}
else if (newCase === this._switchValue) {
if (this._useDefault) {
this._useDefault = false;
this._emptyAllActiveViews();
}
view.create();
this._activeViews.push(view);
}
// Switch to default when there is no more active ViewContainers
if (this._activeViews.length === 0 && !this._useDefault) {
this._useDefault = true;
this._activateViews(this._valueViews.get(_CASE_DEFAULT));
}
}
/** @internal */
_emptyAllActiveViews() {
var activeContainers = this._activeViews;
for (var i = 0; i < activeContainers.length; i++) {
activeContainers[i].destroy();
}
this._activeViews = [];
}
/** @internal */
_activateViews(views) {
// TODO(vicb): assert(this._activeViews.length === 0);
if (isPresent(views)) {
for (var i = 0; i < views.length; i++) {
views[i].create();
}
this._activeViews = views;
}
}
/** @internal */
_registerView(value, view) {
var views = this._valueViews.get(value);
if (isBlank(views)) {
views = [];
this._valueViews.set(value, views);
}
views.push(view);
}
/** @internal */
_deregisterView(value, view) {
// `_CASE_DEFAULT` is used a marker for non-registered cases
if (value === _CASE_DEFAULT)
return;
var views = this._valueViews.get(value);
if (views.length == 1) {
this._valueViews.delete(value);
}
else {
ListWrapper.remove(views, view);
}
}
}
/** @nocollapse */
NgSwitch.decorators = [
{ type: Directive, args: [{ selector: '[ngSwitch]', inputs: ['ngSwitch'] },] },
];
export class NgSwitchCase {
constructor(viewContainer, templateRef, ngSwitch) {
// `_CASE_DEFAULT` is used as a marker for a not yet initialized value
/** @internal */
this._value = _CASE_DEFAULT;
this._switch = ngSwitch;
this._view = new SwitchView(viewContainer, templateRef);
}
set ngSwitchCase(value) {
this._switch._onCaseValueChanged(this._value, value, this._view);
this._value = value;
}
set ngSwitchWhen(value) {
if (!_warned) {
_warned = true;
console.warn('*ngSwitchWhen is deprecated and will be removed. Use *ngSwitchCase instead');
}
this._switch._onCaseValueChanged(this._value, value, this._view);
this._value = value;
}
}
/** @nocollapse */
NgSwitchCase.decorators = [
{ type: Directive, args: [{ selector: '[ngSwitchCase],[ngSwitchWhen]', inputs: ['ngSwitchCase', 'ngSwitchWhen'] },] },
];
/** @nocollapse */
NgSwitchCase.ctorParameters = [
{ type: ViewContainerRef, },
{ type: TemplateRef, },
{ type: NgSwitch, decorators: [{ type: Host },] },
];
export class NgSwitchDefault {
constructor(viewContainer, templateRef, sswitch) {
sswitch._registerView(_CASE_DEFAULT, new SwitchView(viewContainer, templateRef));
}
}
/** @nocollapse */
NgSwitchDefault.decorators = [
{ type: Directive, args: [{ selector: '[ngSwitchDefault]' },] },
];
/** @nocollapse */
NgSwitchDefault.ctorParameters = [
{ type: ViewContainerRef, },
{ type: TemplateRef, },
{ type: NgSwitch, decorators: [{ type: Host },] },
];
//# sourceMappingURL=ng_switch.js.map
\ No newline at end of file
This diff is collapsed.
{"__symbolic":"module","version":1,"metadata":{"NgSwitch":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngSwitch]","inputs":["ngSwitch"]}]}],"members":{"_onCaseValueChanged":[{"__symbolic":"method"}],"_emptyAllActiveViews":[{"__symbolic":"method"}],"_activateViews":[{"__symbolic":"method"}],"_registerView":[{"__symbolic":"method"}],"_deregisterView":[{"__symbolic":"method"}]}},"NgSwitchCase":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngSwitchCase],[ngSwitchWhen]","inputs":["ngSwitchCase","ngSwitchWhen"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host"}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"Object"}]},{"__symbolic":"reference","name":"NgSwitch"}]}]}},"NgSwitchDefault":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngSwitchDefault]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Host"}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"},{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","arguments":[{"__symbolic":"reference","name":"Object"}]},{"__symbolic":"reference","name":"NgSwitch"}]}]}}}}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { TemplateRef, ViewContainerRef } from '@angular/core';
/**
* Creates and inserts an embedded view based on a prepared `TemplateRef`.
* You can attach a context object to the `EmbeddedViewRef` by setting `[ngOutletContext]`.
* `[ngOutletContext]` should be an object, the object's keys will be the local template variables
* available within the `TemplateRef`.
*
* Note: using the key `$implicit` in the context object will set it's value as default.
*
* ### Syntax
* - `<template [ngTemplateOutlet]="templateRefExpression"
* [ngOutletContext]="objectExpression"></template>`
*
* @experimental
*/
export declare class NgTemplateOutlet {
private _viewContainerRef;
private _viewRef;
private _context;
private _templateRef;
constructor(_viewContainerRef: ViewContainerRef);
ngOutletContext: Object;
ngTemplateOutlet: TemplateRef<Object>;
private createView();
}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Directive, Input, ViewContainerRef } from '@angular/core';
import { isPresent } from '../facade/lang';
export class NgTemplateOutlet {
constructor(_viewContainerRef) {
this._viewContainerRef = _viewContainerRef;
}
set ngOutletContext(context) {
if (this._context !== context) {
this._context = context;
if (isPresent(this._viewRef)) {
this.createView();
}
}
}
set ngTemplateOutlet(templateRef) {
if (this._templateRef !== templateRef) {
this._templateRef = templateRef;
this.createView();
}
}
createView() {
if (isPresent(this._viewRef)) {
this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._viewRef));
}
if (isPresent(this._templateRef)) {
this._viewRef = this._viewContainerRef.createEmbeddedView(this._templateRef, this._context);
}
}
}
/** @nocollapse */
NgTemplateOutlet.decorators = [
{ type: Directive, args: [{ selector: '[ngTemplateOutlet]' },] },
];
/** @nocollapse */
NgTemplateOutlet.ctorParameters = [
{ type: ViewContainerRef, },
];
/** @nocollapse */
NgTemplateOutlet.propDecorators = {
'ngOutletContext': [{ type: Input },],
'ngTemplateOutlet': [{ type: Input },],
};
//# sourceMappingURL=ng_template_outlet.js.map
\ No newline at end of file
{"version":3,"file":"ng_template_outlet.js","sourceRoot":"","sources":["../../../../../../modules/@angular/common/src/directives/ng_template_outlet.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAEI,EAAC,SAAS,EAAmB,KAAK,EAAe,gBAAgB,EAAC,MAAM,eAAe;OAEvF,EAAC,SAAS,EAAC,MAAM,gBAAgB;AACxC;IAKE,YAAoB,iBAAmC;QAAnC,sBAAiB,GAAjB,iBAAiB,CAAkB;IAAG,CAAC;IAC3D,IAAI,eAAe,CAAC,OAAe;QACjC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC;YAC9B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAC7B,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,gBAAgB,CAAC,WAAgC;QACnD,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC;YACtC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;YAChC,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAEO,UAAU;QAChB,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC/E,CAAC;QAED,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9F,CAAC;IACH,CAAC;AAcH,CAAC;AAbD,kBAAkB;AACX,2BAAU,GAA0B;IAC3C,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAC,QAAQ,EAAE,oBAAoB,EAAC,EAAG,EAAE;CAC9D,CAAC;AACF,kBAAkB;AACX,+BAAc,GAA2D;IAChF,EAAC,IAAI,EAAE,gBAAgB,GAAG;CACzB,CAAC;AACF,kBAAkB;AACX,+BAAc,GAA2C;IAChE,iBAAiB,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;IACrC,kBAAkB,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;CACrC,CACA","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Directive, EmbeddedViewRef, Input, TemplateRef, ViewContainerRef} from '@angular/core';\n\nimport {isPresent} from '../facade/lang';\nexport class NgTemplateOutlet {\n private _viewRef: EmbeddedViewRef<any>;\n private _context: Object;\n private _templateRef: TemplateRef<any>;\n\n constructor(private _viewContainerRef: ViewContainerRef) {}\n set ngOutletContext(context: Object) {\n if (this._context !== context) {\n this._context = context;\n if (isPresent(this._viewRef)) {\n this.createView();\n }\n }\n }\n set ngTemplateOutlet(templateRef: TemplateRef<Object>) {\n if (this._templateRef !== templateRef) {\n this._templateRef = templateRef;\n this.createView();\n }\n }\n\n private createView() {\n if (isPresent(this._viewRef)) {\n this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._viewRef));\n }\n\n if (isPresent(this._templateRef)) {\n this._viewRef = this._viewContainerRef.createEmbeddedView(this._templateRef, this._context);\n }\n }\n/** @nocollapse */\nstatic decorators: DecoratorInvocation[] = [\n{ type: Directive, args: [{selector: '[ngTemplateOutlet]'}, ] },\n];\n/** @nocollapse */\nstatic ctorParameters: {type: Function, decorators?: DecoratorInvocation[]}[] = [\n{type: ViewContainerRef, },\n];\n/** @nocollapse */\nstatic propDecorators: {[key: string]: DecoratorInvocation[]} = {\n'ngOutletContext': [{ type: Input },],\n'ngTemplateOutlet': [{ type: Input },],\n};\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
{"__symbolic":"module","version":1,"metadata":{"NgTemplateOutlet":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngTemplateOutlet]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef"}]}],"ngOutletContext":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngTemplateOutlet":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"createView":[{"__symbolic":"method"}]}}}}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
export { Observable } from 'rxjs/Observable';
export { Subject } from 'rxjs/Subject';
export { PromiseCompleter, PromiseWrapper } from './promise';
export declare class TimerWrapper {
static setTimeout(fn: (...args: any[]) => void, millis: number): number;
static clearTimeout(id: number): void;
static setInterval(fn: (...args: any[]) => void, millis: number): number;
static clearInterval(id: number): void;
}
export declare class ObservableWrapper {
static subscribe<T>(emitter: any, onNext: (value: T) => void, onError?: (exception: any) => void, onComplete?: () => void): Object;
static isObservable(obs: any): boolean;
/**
* Returns whether `obs` has any subscribers listening to events.
*/
static hasSubscribers(obs: EventEmitter<any>): boolean;
static dispose(subscription: any): void;
/**
* @deprecated - use callEmit() instead
*/
static callNext(emitter: EventEmitter<any>, value: any): void;
static callEmit(emitter: EventEmitter<any>, value: any): void;
static callError(emitter: EventEmitter<any>, error: any): void;
static callComplete(emitter: EventEmitter<any>): void;
static fromPromise(promise: Promise<any>): Observable<any>;
static toPromise(obj: Observable<any>): Promise<any>;
}
/**
* Use by directives and components to emit custom Events.
*
* ### Examples
*
* In the following example, `Zippy` alternatively emits `open` and `close` events when its
* title gets clicked:
*
* ```
* @Component({
* selector: 'zippy',
* template: `
* <div class="zippy">
* <div (click)="toggle()">Toggle</div>
* <div [hidden]="!visible">
* <ng-content></ng-content>
* </div>
* </div>`})
* export class Zippy {
* visible: boolean = true;
* @Output() open: EventEmitter<any> = new EventEmitter();
* @Output() close: EventEmitter<any> = new EventEmitter();
*
* toggle() {
* this.visible = !this.visible;
* if (this.visible) {
* this.open.emit(null);
* } else {
* this.close.emit(null);
* }
* }
* }
* ```
*
* The events payload can be accessed by the parameter `$event` on the components output event
* handler:
*
* ```
* <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
* ```
*
* Uses Rx.Observable but provides an adapter to make it work as specified here:
* https://github.com/jhusain/observable-spec
*
* Once a reference implementation of the spec is available, switch to it.
* @stable
*/
export declare class EventEmitter<T> extends Subject<T> {
__isAsync: boolean;
/**
* Creates an instance of [EventEmitter], which depending on [isAsync],
* delivers events synchronously or asynchronously.
*/
constructor(isAsync?: boolean);
emit(value: T): void;
/**
* @deprecated - use .emit(value) instead
*/
next(value: any): void;
subscribe(generatorOrNext?: any, error?: any, complete?: any): any;
}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Subject } from 'rxjs/Subject';
import { PromiseObservable } from 'rxjs/observable/PromiseObservable';
import { toPromise } from 'rxjs/operator/toPromise';
import { global, noop } from './lang';
export { Observable } from 'rxjs/Observable';
export { Subject } from 'rxjs/Subject';
export { PromiseCompleter, PromiseWrapper } from './promise';
export class TimerWrapper {
static setTimeout(fn, millis) {
return global.setTimeout(fn, millis);
}
static clearTimeout(id) { global.clearTimeout(id); }
static setInterval(fn, millis) {
return global.setInterval(fn, millis);
}
static clearInterval(id) { global.clearInterval(id); }
}
export class ObservableWrapper {
// TODO(vsavkin): when we use rxnext, try inferring the generic type from the first arg
static subscribe(emitter, onNext, onError, onComplete = () => { }) {
onError = (typeof onError === 'function') && onError || noop;
onComplete = (typeof onComplete === 'function') && onComplete || noop;
return emitter.subscribe({ next: onNext, error: onError, complete: onComplete });
}
static isObservable(obs) { return !!obs.subscribe; }
/**
* Returns whether `obs` has any subscribers listening to events.
*/
static hasSubscribers(obs) { return obs.observers.length > 0; }
static dispose(subscription) { subscription.unsubscribe(); }
/**
* @deprecated - use callEmit() instead
*/
static callNext(emitter, value) { emitter.emit(value); }
static callEmit(emitter, value) { emitter.emit(value); }
static callError(emitter, error) { emitter.error(error); }
static callComplete(emitter) { emitter.complete(); }
static fromPromise(promise) {
return PromiseObservable.create(promise);
}
static toPromise(obj) { return toPromise.call(obj); }
}
/**
* Use by directives and components to emit custom Events.
*
* ### Examples
*
* In the following example, `Zippy` alternatively emits `open` and `close` events when its
* title gets clicked:
*
* ```
* @Component({
* selector: 'zippy',
* template: `
* <div class="zippy">
* <div (click)="toggle()">Toggle</div>
* <div [hidden]="!visible">
* <ng-content></ng-content>
* </div>
* </div>`})
* export class Zippy {
* visible: boolean = true;
* @Output() open: EventEmitter<any> = new EventEmitter();
* @Output() close: EventEmitter<any> = new EventEmitter();
*
* toggle() {
* this.visible = !this.visible;
* if (this.visible) {
* this.open.emit(null);
* } else {
* this.close.emit(null);
* }
* }
* }
* ```
*
* The events payload can be accessed by the parameter `$event` on the components output event
* handler:
*
* ```
* <zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
* ```
*
* Uses Rx.Observable but provides an adapter to make it work as specified here:
* https://github.com/jhusain/observable-spec
*
* Once a reference implementation of the spec is available, switch to it.
* @stable
*/
export class EventEmitter extends Subject {
/**
* Creates an instance of [EventEmitter], which depending on [isAsync],
* delivers events synchronously or asynchronously.
*/
constructor(isAsync = false) {
super();
this.__isAsync = isAsync;
}
emit(value) { super.next(value); }
/**
* @deprecated - use .emit(value) instead
*/
next(value) { super.next(value); }
subscribe(generatorOrNext, error, complete) {
let schedulerFn;
let errorFn = (err) => null;
let completeFn = () => null;
if (generatorOrNext && typeof generatorOrNext === 'object') {
schedulerFn = this.__isAsync ? (value /** TODO #9100 */) => {
setTimeout(() => generatorOrNext.next(value));
} : (value /** TODO #9100 */) => { generatorOrNext.next(value); };
if (generatorOrNext.error) {
errorFn = this.__isAsync ? (err) => { setTimeout(() => generatorOrNext.error(err)); } :
(err) => { generatorOrNext.error(err); };
}
if (generatorOrNext.complete) {
completeFn = this.__isAsync ? () => { setTimeout(() => generatorOrNext.complete()); } :
() => { generatorOrNext.complete(); };
}
}
else {
schedulerFn = this.__isAsync ? (value /** TODO #9100 */) => {
setTimeout(() => generatorOrNext(value));
} : (value /** TODO #9100 */) => { generatorOrNext(value); };
if (error) {
errorFn =
this.__isAsync ? (err) => { setTimeout(() => error(err)); } : (err) => { error(err); };
}
if (complete) {
completeFn =
this.__isAsync ? () => { setTimeout(() => complete()); } : () => { complete(); };
}
}
return super.subscribe(schedulerFn, errorFn, completeFn);
}
}
//# sourceMappingURL=async.js.map
\ No newline at end of file
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../../../../../modules/@angular/common/src/facade/async.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAGI,EAAC,OAAO,EAAC,MAAM,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C3C,CAAC,GAAG,CAAC,KAAU,CAAC,iBAAiB,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAElE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;gBACV,OAAO;oBACH,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7F,CAAC;YAED,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACb,UAAU;oBACN,IAAI,CAAC,SAAS,GAAG,QAAQ,UAAU,CAAC,MAAM,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;YACvF,CAAC;QACH,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC;AAAA","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable} from 'rxjs/Observable';\nimport {Subject} from 'rxjs/Subject';\nimport {PromiseObservable} from 'rxjs/observable/PromiseObservable';\nimport {toPromise} from 'rxjs/operator/toPromise';\n\nimport {global, noop} from './lang';\n\nexport {Observable} from 'rxjs/Observable';\nexport {Subject} from 'rxjs/Subject';\nexport {PromiseCompleter, PromiseWrapper} from './promise';\n\nexport class TimerWrapper {\n static setTimeout(fn: (...args: any[]) => void, millis: number): number {\n return global.setTimeout(fn, millis);\n }\n static clearTimeout(id: number): void { global.clearTimeout(id); }\n\n static setInterval(fn: (...args: any[]) => void, millis: number): number {\n return global.setInterval(fn, millis);\n }\n static clearInterval(id: number): void { global.clearInterval(id); }\n}\n\nexport class ObservableWrapper {\n // TODO(vsavkin): when we use rxnext, try inferring the generic type from the first arg\n static subscribe<T>(\n emitter: any, onNext: (value: T) => void, onError?: (exception: any) => void,\n onComplete: () => void = () => {}): Object {\n onError = (typeof onError === 'function') && onError || noop;\n onComplete = (typeof onComplete === 'function') && onComplete || noop;\n return emitter.subscribe({next: onNext, error: onError, complete: onComplete});\n }\n\n static isObservable(obs: any): boolean { return !!obs.subscribe; }\n\n /**\n * Returns whether `obs` has any subscribers listening to events.\n */\n static hasSubscribers(obs: EventEmitter<any>): boolean { return obs.observers.length > 0; }\n\n static dispose(subscription: any) { subscription.unsubscribe(); }\n\n /**\n * @deprecated - use callEmit() instead\n */\n static callNext(emitter: EventEmitter<any>, value: any) { emitter.emit(value); }\n\n static callEmit(emitter: EventEmitter<any>, value: any) { emitter.emit(value); }\n\n static callError(emitter: EventEmitter<any>, error: any) { emitter.error(error); }\n\n static callComplete(emitter: EventEmitter<any>) { emitter.complete(); }\n\n static fromPromise(promise: Promise<any>): Observable<any> {\n return PromiseObservable.create(promise);\n }\n\n static toPromise(obj: Observable<any>): Promise<any> { return toPromise.call(obj); }\n}\n\n/**\n * Use by directives and components to emit custom Events.\n *\n * ### Examples\n *\n * In the following example, `Zippy` alternatively emits `open` and `close` events when its\n * title gets clicked:\n *\n * ```\n * @Component({\n * selector: 'zippy',\n * template: `\n * <div class=\"zippy\">\n * <div (click)=\"toggle()\">Toggle</div>\n * <div [hidden]=\"!visible\">\n * <ng-content></ng-content>\n * </div>\n * </div>`})\n * export class Zippy {\n * visible: boolean = true;\n * @Output() open: EventEmitter<any> = new EventEmitter();\n * @Output() close: EventEmitter<any> = new EventEmitter();\n *\n * toggle() {\n * this.visible = !this.visible;\n * if (this.visible) {\n * this.open.emit(null);\n * } else {\n * this.close.emit(null);\n * }\n * }\n * }\n * ```\n *\n * The events payload can be accessed by the parameter `$event` on the components output event\n * handler:\n *\n * ```\n * <zippy (open)=\"onOpen($event)\" (close)=\"onClose($event)\"></zippy>\n * ```\n *\n * Uses Rx.Observable but provides an adapter to make it work as specified here:\n * https://github.com/jhusain/observable-spec\n *\n * Once a reference implementation of the spec is available, switch to it.\n * @stable\n */\nexport class EventEmitter<T> extends Subject<T> {\n // TODO: mark this as internal once all the facades are gone\n // we can't mark it as internal now because EventEmitter exported via @angular/core would not\n // contain this property making it incompatible with all the code that uses EventEmitter via\n // facades, which are local to the code and do not have this property stripped.\n // tslint:disable-next-line\n __isAsync: boolean;\n\n /**\n * Creates an instance of [EventEmitter], which depending on [isAsync],\n * delivers events synchronously or asynchronously.\n */\n constructor(isAsync: boolean = false) {\n super();\n this.__isAsync = isAsync;\n }\n\n emit(value: T) { super.next(value); }\n\n /**\n * @deprecated - use .emit(value) instead\n */\n next(value: any) { super.next(value); }\n\n subscribe(generatorOrNext?: any, error?: any, complete?: any): any {\n let schedulerFn: any /** TODO #9100 */;\n let errorFn = (err: any): any /** TODO #9100 */ => null;\n let completeFn = (): any /** TODO #9100 */ => null;\n\n if (generatorOrNext && typeof generatorOrNext === 'object') {\n schedulerFn = this.__isAsync ? (value: any /** TODO #9100 */) => {\n setTimeout(() => generatorOrNext.next(value));\n } : (value: any /** TODO #9100 */) => { generatorOrNext.next(value); };\n\n if (generatorOrNext.error) {\n errorFn = this.__isAsync ? (err) => { setTimeout(() => generatorOrNext.error(err)); } :\n (err) => { generatorOrNext.error(err); };\n }\n\n if (generatorOrNext.complete) {\n completeFn = this.__isAsync ? () => { setTimeout(() => generatorOrNext.complete()); } :\n () => { generatorOrNext.complete(); };\n }\n } else {\n schedulerFn = this.__isAsync ? (value: any /** TODO #9100 */) => {\n setTimeout(() => generatorOrNext(value));\n } : (value: any /** TODO #9100 */) => { generatorOrNext(value); };\n\n if (error) {\n errorFn =\n this.__isAsync ? (err) => { setTimeout(() => error(err)); } : (err) => { error(err); };\n }\n\n if (complete) {\n completeFn =\n this.__isAsync ? () => { setTimeout(() => complete()); } : () => { complete(); };\n }\n }\n\n return super.subscribe(schedulerFn, errorFn, completeFn);\n }\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* A base class for the WrappedException that can be used to identify
* a WrappedException from ExceptionHandler without adding circular
* dependency.
*/
export declare class BaseWrappedException extends Error {
constructor(message: string);
readonly wrapperMessage: string;
readonly wrapperStack: any;
readonly originalException: any;
readonly originalStack: any;
readonly context: any;
readonly message: string;
}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* A base class for the WrappedException that can be used to identify
* a WrappedException from ExceptionHandler without adding circular
* dependency.
*/
export class BaseWrappedException extends Error {
constructor(message) {
super(message);
}
get wrapperMessage() { return ''; }
get wrapperStack() { return null; }
get originalException() { return null; }
get originalStack() { return null; }
get context() { return null; }
get message() { return ''; }
}
//# sourceMappingURL=base_wrapped_exception.js.map
\ No newline at end of file
{"version":3,"file":"base_wrapped_exception.js","sourceRoot":"","sources":["../../../../../../modules/@angular/common/src/facade/base_wrapped_exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,0CAA0C,KAAK;IAC7C,YAAY,OAAe;QAAI,MAAM,OAAO,CAAC,CAAC;IAAC,CAAC;IAEhD,IAAI,cAAc,KAAa,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3C,IAAI,YAAY,KAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,IAAI,iBAAiB,KAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,IAAI,aAAa,KAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,IAAI,OAAO,KAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACnC,IAAI,OAAO,KAAa,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;AACtC,CAAC;AAAA","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A base class for the WrappedException that can be used to identify\n * a WrappedException from ExceptionHandler without adding circular\n * dependency.\n */\nexport class BaseWrappedException extends Error {\n constructor(message: string) { super(message); }\n\n get wrapperMessage(): string { return ''; }\n get wrapperStack(): any { return null; }\n get originalException(): any { return null; }\n get originalStack(): any { return null; }\n get context(): any { return null; }\n get message(): string { return ''; }\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
export declare var Map: MapConstructor;
export declare var Set: SetConstructor;
export declare class MapWrapper {
static clone<K, V>(m: Map<K, V>): Map<K, V>;
static createFromStringMap<T>(stringMap: {
[key: string]: T;
}): Map<string, T>;
static toStringMap<T>(m: Map<string, T>): {
[key: string]: T;
};
static createFromPairs(pairs: any[]): Map<any, any>;
static clearValues(m: Map<any, any>): void;
static iterable<T>(m: T): T;
static keys<K>(m: Map<K, any>): K[];
static values<V>(m: Map<any, V>): V[];
}
/**
* Wraps Javascript Objects
*/
export declare class StringMapWrapper {
static create(): {
[k: string]: any;
};
static contains(map: {
[key: string]: any;
}, key: string): boolean;
static get<V>(map: {
[key: string]: V;
}, key: string): V;
static set<V>(map: {
[key: string]: V;
}, key: string, value: V): void;
static keys(map: {
[key: string]: any;
}): string[];
static values<T>(map: {
[key: string]: T;
}): T[];
static isEmpty(map: {
[key: string]: any;
}): boolean;
static delete(map: {
[key: string]: any;
}, key: string): void;
static forEach<K, V>(map: {
[key: string]: V;
}, callback: Function): void;
static merge<V>(m1: {
[key: string]: V;
}, m2: {
[key: string]: V;
}): {
[key: string]: V;
};
static equals<V>(m1: {
[key: string]: V;
}, m2: {
[key: string]: V;
}): boolean;
}
/**
* A boolean-valued function over a value, possibly including context information
* regarding that value's position in an array.
*/
export interface Predicate<T> {
(value: T, index?: number, array?: T[]): boolean;
}
export declare class ListWrapper {
static createFixedSize(size: number): any[];
static createGrowableSize(size: number): any[];
static clone<T>(array: T[]): T[];
static forEachWithIndex<T>(array: T[], fn: (t: T, n: number) => void): void;
static first<T>(array: T[]): T;
static last<T>(array: T[]): T;
static indexOf<T>(array: T[], value: T, startIndex?: number): number;
static contains<T>(list: T[], el: T): boolean;
static reversed<T>(array: T[]): T[];
static concat(a: any[], b: any[]): any[];
static insert<T>(list: T[], index: number, value: T): void;
static removeAt<T>(list: T[], index: number): T;
static removeAll<T>(list: T[], items: T[]): void;
static remove<T>(list: T[], el: T): boolean;
static clear(list: any[]): void;
static isEmpty(list: any[]): boolean;
static fill(list: any[], value: any, start?: number, end?: number): void;
static equals(a: any[], b: any[]): boolean;
static slice<T>(l: T[], from?: number, to?: number): T[];
static splice<T>(l: T[], from: number, length: number): T[];
static sort<T>(l: T[], compareFn?: (a: T, b: T) => number): void;
static toString<T>(l: T[]): string;
static toJSON<T>(l: T[]): string;
static maximum<T>(list: T[], predicate: (t: T) => number): T;
static flatten<T>(list: Array<T | T[]>): T[];
static addAll<T>(list: Array<T>, source: Array<T>): void;
}
export declare function isListLikeIterable(obj: any): boolean;
export declare function areIterablesEqual(a: any, b: any, comparator: Function): boolean;
export declare function iterateListLike(obj: any, fn: Function): void;
export declare class SetWrapper {
static createFromList<T>(lst: T[]): Set<T>;
static has<T>(s: Set<T>, key: T): boolean;
static delete<K>(m: Set<K>, k: K): void;
}
This diff is collapsed.
This diff is collapsed.
{"__symbolic":"module","version":1,"metadata":{"Map":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"./lang","name":"global"},"member":"Map"},"Set":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"./lang","name":"global"},"member":"Set"}}}
\ No newline at end of file
/**
* Provides a hook for centralized exception handling.
*
* The default implementation of `ExceptionHandler` prints error messages to the `Console`. To
* intercept error handling,
* write a custom exception handler that replaces this default as appropriate for your app.
*
* ### Example
*
* ```javascript
*
* class MyExceptionHandler implements ExceptionHandler {
* call(error, stackTrace = null, reason = null) {
* // do something with the exception
* }
* }
*
* bootstrap(MyApp, {provide: ExceptionHandler, useClass: MyExceptionHandler}])
*
* ```
* @stable
*/
export declare class ExceptionHandler {
private _logger;
private _rethrowException;
constructor(_logger: any, _rethrowException?: boolean);
static exceptionToString(exception: any, stackTrace?: any, reason?: string): string;
call(exception: any, stackTrace?: any, reason?: string): void;
}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { BaseWrappedException } from './base_wrapped_exception';
import { isListLikeIterable } from './collection';
import { isBlank, isPresent } from './lang';
class _ArrayLogger {
constructor() {
this.res = [];
}
log(s) { this.res.push(s); }
logError(s) { this.res.push(s); }
logGroup(s) { this.res.push(s); }
logGroupEnd() { }
;
}
/**
* Provides a hook for centralized exception handling.
*
* The default implementation of `ExceptionHandler` prints error messages to the `Console`. To
* intercept error handling,
* write a custom exception handler that replaces this default as appropriate for your app.
*
* ### Example
*
* ```javascript
*
* class MyExceptionHandler implements ExceptionHandler {
* call(error, stackTrace = null, reason = null) {
* // do something with the exception
* }
* }
*
* bootstrap(MyApp, {provide: ExceptionHandler, useClass: MyExceptionHandler}])
*
* ```
* @stable
*/
export class ExceptionHandler {
constructor(_logger, _rethrowException = true) {
this._logger = _logger;
this._rethrowException = _rethrowException;
}
static exceptionToString(exception, stackTrace = null, reason = null) {
var l = new _ArrayLogger();
var e = new ExceptionHandler(l, false);
e.call(exception, stackTrace, reason);
return l.res.join('\n');
}
call(exception, stackTrace = null, reason = null) {
var originalException = this._findOriginalException(exception);
var originalStack = this._findOriginalStack(exception);
var context = this._findContext(exception);
this._logger.logGroup(`EXCEPTION: ${this._extractMessage(exception)}`);
if (isPresent(stackTrace) && isBlank(originalStack)) {
this._logger.logError('STACKTRACE:');
this._logger.logError(this._longStackTrace(stackTrace));
}
if (isPresent(reason)) {
this._logger.logError(`REASON: ${reason}`);
}
if (isPresent(originalException)) {
this._logger.logError(`ORIGINAL EXCEPTION: ${this._extractMessage(originalException)}`);
}
if (isPresent(originalStack)) {
this._logger.logError('ORIGINAL STACKTRACE:');
this._logger.logError(this._longStackTrace(originalStack));
}
if (isPresent(context)) {
this._logger.logError('ERROR CONTEXT:');
this._logger.logError(context);
}
this._logger.logGroupEnd();
// We rethrow exceptions, so operations like 'bootstrap' will result in an error
// when an exception happens. If we do not rethrow, bootstrap will always succeed.
if (this._rethrowException)
throw exception;
}
/** @internal */
_extractMessage(exception) {
return exception instanceof BaseWrappedException ? exception.wrapperMessage :
exception.toString();
}
/** @internal */
_longStackTrace(stackTrace) {
return isListLikeIterable(stackTrace) ? stackTrace.join('\n\n-----async gap-----\n') :
stackTrace.toString();
}
/** @internal */
_findContext(exception) {
try {
if (!(exception instanceof BaseWrappedException))
return null;
return isPresent(exception.context) ? exception.context :
this._findContext(exception.originalException);
}
catch (e) {
// exception.context can throw an exception. if it happens, we ignore the context.
return null;
}
}
/** @internal */
_findOriginalException(exception) {
if (!(exception instanceof BaseWrappedException))
return null;
var e = exception.originalException;
while (e instanceof BaseWrappedException && isPresent(e.originalException)) {
e = e.originalException;
}
return e;
}
/** @internal */
_findOriginalStack(exception) {
if (!(exception instanceof BaseWrappedException))
return null;
var e = exception;
var stack = exception.originalStack;
while (e instanceof BaseWrappedException && isPresent(e.originalException)) {
e = e.originalException;
if (e instanceof BaseWrappedException && isPresent(e.originalException)) {
stack = e.originalStack;
}
}
return stack;
}
}
//# sourceMappingURL=exception_handler.js.map
\ No newline at end of file
{"version":3,"file":"exception_handler.js","sourceRoot":"","sources":["../../../../../../modules/@angular/common/src/facade/exception_handler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAEI,EAAC,oBAAoB,EAAC,MAAM,0BAA0B;OACtD,EAAC,kBAAkB,EAAC,MAAM,cAAc;OACxC,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,QAAQ;AAEzC;IAAA;QACE,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AAS,YAAY,oBAAoB,CAAC,CAAC;YAAC,MAAM,CAAC,IAAI,CAAC;QAE9D,IAAI,CAAC,GAAG,SAAS,CAAC;QAClB,IAAI,KAAK,GAAG,SAAS,CAAC,aAAa,CAAC;QACpC,OAAO,CAAC,YAAY,oBAAoB,IAAI,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC;YAC3E,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAAC;YACxB,EAAE,CAAC,CAAC,CAAC,YAAY,oBAAoB,IAAI,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;gBACxE,KAAK,GAAG,CAAC,CAAC,aAAa,CAAC;YAC1B,CAAC;QACH,CAAC;QAED,MAAM,CAAC,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAAA","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseWrappedException} from './base_wrapped_exception';\nimport {isListLikeIterable} from './collection';\nimport {isBlank, isPresent} from './lang';\n\nclass _ArrayLogger {\n res: any[] = [];\n log(s: any): void { this.res.push(s); }\n logError(s: any): void { this.res.push(s); }\n logGroup(s: any): void { this.res.push(s); }\n logGroupEnd(){};\n}\n\n/**\n * Provides a hook for centralized exception handling.\n *\n * The default implementation of `ExceptionHandler` prints error messages to the `Console`. To\n * intercept error handling,\n * write a custom exception handler that replaces this default as appropriate for your app.\n *\n * ### Example\n *\n * ```javascript\n *\n * class MyExceptionHandler implements ExceptionHandler {\n * call(error, stackTrace = null, reason = null) {\n * // do something with the exception\n * }\n * }\n *\n * bootstrap(MyApp, {provide: ExceptionHandler, useClass: MyExceptionHandler}])\n *\n * ```\n * @stable\n */\nexport class ExceptionHandler {\n constructor(private _logger: any, private _rethrowException: boolean = true) {}\n\n static exceptionToString(exception: any, stackTrace: any = null, reason: string = null): string {\n var l = new _ArrayLogger();\n var e = new ExceptionHandler(l, false);\n e.call(exception, stackTrace, reason);\n return l.res.join('\\n');\n }\n\n call(exception: any, stackTrace: any = null, reason: string = null): void {\n var originalException = this._findOriginalException(exception);\n var originalStack = this._findOriginalStack(exception);\n var context = this._findContext(exception);\n\n this._logger.logGroup(`EXCEPTION: ${this._extractMessage(exception)}`);\n\n if (isPresent(stackTrace) && isBlank(originalStack)) {\n this._logger.logError('STACKTRACE:');\n this._logger.logError(this._longStackTrace(stackTrace));\n }\n\n if (isPresent(reason)) {\n this._logger.logError(`REASON: ${reason}`);\n }\n\n if (isPresent(originalException)) {\n this._logger.logError(`ORIGINAL EXCEPTION: ${this._extractMessage(originalException)}`);\n }\n\n if (isPresent(originalStack)) {\n this._logger.logError('ORIGINAL STACKTRACE:');\n this._logger.logError(this._longStackTrace(originalStack));\n }\n\n if (isPresent(context)) {\n this._logger.logError('ERROR CONTEXT:');\n this._logger.logError(context);\n }\n\n this._logger.logGroupEnd();\n\n // We rethrow exceptions, so operations like 'bootstrap' will result in an error\n // when an exception happens. If we do not rethrow, bootstrap will always succeed.\n if (this._rethrowException) throw exception;\n }\n\n /** @internal */\n _extractMessage(exception: any): string {\n return exception instanceof BaseWrappedException ? exception.wrapperMessage :\n exception.toString();\n }\n\n /** @internal */\n _longStackTrace(stackTrace: any): any {\n return isListLikeIterable(stackTrace) ? (<any[]>stackTrace).join('\\n\\n-----async gap-----\\n') :\n stackTrace.toString();\n }\n\n /** @internal */\n _findContext(exception: any): any {\n try {\n if (!(exception instanceof BaseWrappedException)) return null;\n return isPresent(exception.context) ? exception.context :\n this._findContext(exception.originalException);\n } catch (e) {\n // exception.context can throw an exception. if it happens, we ignore the context.\n return null;\n }\n }\n\n /** @internal */\n _findOriginalException(exception: any): any {\n if (!(exception instanceof BaseWrappedException)) return null;\n\n var e = exception.originalException;\n while (e instanceof BaseWrappedException && isPresent(e.originalException)) {\n e = e.originalException;\n }\n\n return e;\n }\n\n /** @internal */\n _findOriginalStack(exception: any): any {\n if (!(exception instanceof BaseWrappedException)) return null;\n\n var e = exception;\n var stack = exception.originalStack;\n while (e instanceof BaseWrappedException && isPresent(e.originalException)) {\n e = e.originalException;\n if (e instanceof BaseWrappedException && isPresent(e.originalException)) {\n stack = e.originalStack;\n }\n }\n\n return stack;\n }\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { BaseWrappedException } from './base_wrapped_exception';
export { ExceptionHandler } from './exception_handler';
/**
* @stable
*/
export declare class BaseException extends Error {
message: string;
stack: any;
constructor(message?: string);
toString(): string;
}
/**
* Wraps an exception and provides additional context or information.
* @stable
*/
export declare class WrappedException extends BaseWrappedException {
private _wrapperMessage;
private _originalException;
private _originalStack;
private _context;
private _wrapperStack;
constructor(_wrapperMessage: string, _originalException: any, _originalStack?: any, _context?: any);
readonly wrapperMessage: string;
readonly wrapperStack: any;
readonly originalException: any;
readonly originalStack: any;
readonly context: any;
readonly message: string;
toString(): string;
}
export declare function makeTypeError(message?: string): Error;
export declare function unimplemented(): any;
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { BaseWrappedException } from './base_wrapped_exception';
import { ExceptionHandler } from './exception_handler';
export { ExceptionHandler } from './exception_handler';
/**
* @stable
*/
export class BaseException extends Error {
constructor(message = '--') {
super(message);
this.message = message;
this.stack = (new Error(message)).stack;
}
toString() { return this.message; }
}
/**
* Wraps an exception and provides additional context or information.
* @stable
*/
export class WrappedException extends BaseWrappedException {
constructor(_wrapperMessage, _originalException /** TODO #9100 */, _originalStack /** TODO #9100 */, _context /** TODO #9100 */) {
super(_wrapperMessage);
this._wrapperMessage = _wrapperMessage;
this._originalException = _originalException;
this._originalStack = _originalStack;
this._context = _context;
this._wrapperStack = (new Error(_wrapperMessage)).stack;
}
get wrapperMessage() { return this._wrapperMessage; }
get wrapperStack() { return this._wrapperStack; }
get originalException() { return this._originalException; }
get originalStack() { return this._originalStack; }
get context() { return this._context; }
get message() { return ExceptionHandler.exceptionToString(this); }
toString() { return this.message; }
}
export function makeTypeError(message) {
return new TypeError(message);
}
export function unimplemented() {
throw new BaseException('unimplemented');
}
//# sourceMappingURL=exceptions.js.map
\ No newline at end of file
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../../../../../modules/@angular/common/src/facade/exceptions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;OAEI,EAAC,oBAAoB,EAAC,MAAM,0BAA0B;OACtD,EAAC,gBAAgB,EAAC,MAAM,qBAAqB;AAEpD,SAAQ,gBAAgB,QAAO,qBAAqB,CAAC;AAErD;;GAEG;AACH,mCAAmC,KAAK;IAEtC,YAAmB,OAAO,GAAW,IAAI;QACvC,MAAM,OAAO,CAAC,CAAC;QADE,YAAO,GAAP,OAAO,CAAe;QAEvC,IAAI,CAAC,KAAK,GAAG,CAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAC/C,CAAC;IAED,QAAQ,KAAa,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,sCAAsC,oBAAoB;IAGxD,YACY,eAAuB,EAAU,kBAAuB,CAAC,iBAAiB,EAC1E,cAAoB,CAAC,iBAAiB,EAAU,QAAc,CAAC,iBAAiB;QAC1F,MAAM,eAAe,CAAC,CAAC;QAFb,oBAAe,GAAf,eAAe,CAAQ;QAAU,uBAAkB,GAAlB,kBAAkB,CAAK;QACxD,mBAAc,GAAd,cAAc,CAAM;QAA4B,aAAQ,GAAR,QAAQ,CAAM;QAExE,IAAI,CAAC,aAAa,GAAG,CAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC;IAC/D,CAAC;IAED,IAAI,cAAc,KAAa,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IAE7D,IAAI,YAAY,KAAU,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAGtD,IAAI,iBAAiB,KAAU,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAEhE,IAAI,aAAa,KAAU,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAGxD,IAAI,OAAO,KAAU,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE5C,IAAI,OAAO,KAAa,MAAM,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE1E,QAAQ,KAAa,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED,8BAA8B,OAAgB;IAC5C,MAAM,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED;IACE,MAAM,IAAI,aAAa,CAAC,eAAe,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseWrappedException} from './base_wrapped_exception';\nimport {ExceptionHandler} from './exception_handler';\n\nexport {ExceptionHandler} from './exception_handler';\n\n/**\n * @stable\n */\nexport class BaseException extends Error {\n public stack: any;\n constructor(public message: string = '--') {\n super(message);\n this.stack = (<any>new Error(message)).stack;\n }\n\n toString(): string { return this.message; }\n}\n\n/**\n * Wraps an exception and provides additional context or information.\n * @stable\n */\nexport class WrappedException extends BaseWrappedException {\n private _wrapperStack: any;\n\n constructor(\n private _wrapperMessage: string, private _originalException: any /** TODO #9100 */,\n private _originalStack?: any /** TODO #9100 */, private _context?: any /** TODO #9100 */) {\n super(_wrapperMessage);\n this._wrapperStack = (<any>new Error(_wrapperMessage)).stack;\n }\n\n get wrapperMessage(): string { return this._wrapperMessage; }\n\n get wrapperStack(): any { return this._wrapperStack; }\n\n\n get originalException(): any { return this._originalException; }\n\n get originalStack(): any { return this._originalStack; }\n\n\n get context(): any { return this._context; }\n\n get message(): string { return ExceptionHandler.exceptionToString(this); }\n\n toString(): string { return this.message; }\n}\n\nexport function makeTypeError(message?: string): Error {\n return new TypeError(message);\n}\n\nexport function unimplemented(): any {\n throw new BaseException('unimplemented');\n}\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\ No newline at end of file
{"__symbolic":"module","version":1,"metadata":{"makeTypeError":{"__symbolic":"function","parameters":["message"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"TypeError"},"arguments":[{"__symbolic":"reference","name":"message"}]}}}}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export declare enum NumberFormatStyle {
Decimal = 0,
Percent = 1,
Currency = 2,
}
export declare class NumberFormatter {
static format(num: number, locale: string, style: NumberFormatStyle, {minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, currency, currencyAsSymbol}?: {
minimumIntegerDigits?: number;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
currency?: string;
currencyAsSymbol?: boolean;
}): string;
}
export declare class DateFormatter {
static format(date: Date, locale: string, pattern: string): string;
}
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export var NumberFormatStyle;
(function (NumberFormatStyle) {
NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal";
NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent";
NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency";
})(NumberFormatStyle || (NumberFormatStyle = {}));
export class NumberFormatter {
static format(num, locale, style, { minimumIntegerDigits = 1, minimumFractionDigits = 0, maximumFractionDigits = 3, currency, currencyAsSymbol = false } = {}) {
var intlOptions = {
minimumIntegerDigits: minimumIntegerDigits,
minimumFractionDigits: minimumFractionDigits,
maximumFractionDigits: maximumFractionDigits
};
intlOptions.style = NumberFormatStyle[style].toLowerCase();
if (style == NumberFormatStyle.Currency) {
intlOptions.currency = currency;
intlOptions.currencyDisplay = currencyAsSymbol ? 'symbol' : 'code';
}
return new Intl.NumberFormat(locale, intlOptions).format(num);
}
}
var DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsaZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|Z|G+|w+))(.*)/;
var PATTERN_ALIASES = {
yMMMdjms: datePartGetterFactory(combine([
digitCondition('year', 1),
nameCondition('month', 3),
digitCondition('day', 1),
digitCondition('hour', 1),
digitCondition('minute', 1),
digitCondition('second', 1),
])),
yMdjm: datePartGetterFactory(combine([
digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1),
digitCondition('hour', 1), digitCondition('minute', 1)
])),
yMMMMEEEEd: datePartGetterFactory(combine([
digitCondition('year', 1), nameCondition('month', 4), nameCondition('weekday', 4),
digitCondition('day', 1)
])),
yMMMMd: datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 4), digitCondition('day', 1)])),
yMMMd: datePartGetterFactory(combine([digitCondition('year', 1), nameCondition('month', 3), digitCondition('day', 1)])),
yMd: datePartGetterFactory(combine([digitCondition('year', 1), digitCondition('month', 1), digitCondition('day', 1)])),
jms: datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('second', 1), digitCondition('minute', 1)])),
jm: datePartGetterFactory(combine([digitCondition('hour', 1), digitCondition('minute', 1)]))
};
var DATE_FORMATS = {
yyyy: datePartGetterFactory(digitCondition('year', 4)),
yy: datePartGetterFactory(digitCondition('year', 2)),
y: datePartGetterFactory(digitCondition('year', 1)),
MMMM: datePartGetterFactory(nameCondition('month', 4)),
MMM: datePartGetterFactory(nameCondition('month', 3)),
MM: datePartGetterFactory(digitCondition('month', 2)),
M: datePartGetterFactory(digitCondition('month', 1)),
LLLL: datePartGetterFactory(nameCondition('month', 4)),
dd: datePartGetterFactory(digitCondition('day', 2)),
d: datePartGetterFactory(digitCondition('day', 1)),
HH: hourExtracter(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), false))),
H: hourExtracter(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), false))),
hh: hourExtracter(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), true))),
h: hourExtracter(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),
jj: datePartGetterFactory(digitCondition('hour', 2)),
j: datePartGetterFactory(digitCondition('hour', 1)),
mm: digitModifier(datePartGetterFactory(digitCondition('minute', 2))),
m: datePartGetterFactory(digitCondition('minute', 1)),
ss: digitModifier(datePartGetterFactory(digitCondition('second', 2))),
s: datePartGetterFactory(digitCondition('second', 1)),
// while ISO 8601 requires fractions to be prefixed with `.` or `,`
// we can be just safely rely on using `sss` since we currently don't support single or two digit
// fractions
sss: datePartGetterFactory(digitCondition('second', 3)),
EEEE: datePartGetterFactory(nameCondition('weekday', 4)),
EEE: datePartGetterFactory(nameCondition('weekday', 3)),
EE: datePartGetterFactory(nameCondition('weekday', 2)),
E: datePartGetterFactory(nameCondition('weekday', 1)),
a: hourClockExtracter(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),
Z: datePartGetterFactory({ timeZoneName: 'long' }),
z: datePartGetterFactory({ timeZoneName: 'short' }),
ww: datePartGetterFactory({}),
// first Thursday of the year. not support ?
w: datePartGetterFactory({}),
// of the year not support ?
G: datePartGetterFactory(nameCondition('era', 1)),
GG: datePartGetterFactory(nameCondition('era', 2)),
GGG: datePartGetterFactory(nameCondition('era', 3)),
GGGG: datePartGetterFactory(nameCondition('era', 4))
};
function digitModifier(inner) {
return function (date, locale) {
var result = inner(date, locale);
return result.length == 1 ? '0' + result : result;
};
}
function hourClockExtracter(inner) {
return function (date, locale) {
var result = inner(date, locale);
return result.split(' ')[1];
};
}
function hourExtracter(inner) {
return function (date, locale) {
var result = inner(date, locale);
return result.split(' ')[0];
};
}
function hour12Modify(options, value) {
options.hour12 = value;
return options;
}
function digitCondition(prop, len) {
var result = {};
result[prop] = len == 2 ? '2-digit' : 'numeric';
return result;
}
function nameCondition(prop, len) {
var result = {};
result[prop] = len < 4 ? 'short' : 'long';
return result;
}
function combine(options) {
var result = {};
options.forEach(option => { Object.assign(result, option); });
return result;
}
function datePartGetterFactory(ret) {
return function (date, locale) {
return new Intl.DateTimeFormat(locale, ret).format(date);
};
}
var datePartsFormatterCache = new Map();
function dateFormatter(format, date, locale) {
var text = '';
var match;
var fn;
var parts = [];
if (PATTERN_ALIASES[format]) {
return PATTERN_ALIASES[format](date, locale);
}
if (datePartsFormatterCache.has(format)) {
parts = datePartsFormatterCache.get(format);
}
else {
var matchs = DATE_FORMATS_SPLIT.exec(format);
while (format) {
match = DATE_FORMATS_SPLIT.exec(format);
if (match) {
parts = concat(parts, match, 1);
format = parts.pop();
}
else {
parts.push(format);
format = null;
}
}
datePartsFormatterCache.set(format, parts);
}
parts.forEach(part => {
fn = DATE_FORMATS[part];
text += fn ? fn(date, locale) :
part === '\'\'' ? '\'' : part.replace(/(^'|'$)/g, '').replace(/''/g, '\'');
});
return text;
}
var slice = [].slice;
function concat(array1 /** TODO #9100 */, array2 /** TODO #9100 */, index /** TODO #9100 */) {
return array1.concat(slice.call(array2, index));
}
export class DateFormatter {
static format(date, locale, pattern) {
return dateFormatter(pattern, date, locale);
}
}
//# sourceMappingURL=intl.js.map
\ No newline at end of file
This diff is collapsed.
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export interface BrowserNodeGlobal {
Object: typeof Object;
Array: typeof Array;
Map: typeof Map;
Set: typeof Set;
Date: DateConstructor;
RegExp: RegExpConstructor;
JSON: typeof JSON;
Math: any;
assert(condition: any): void;
Reflect: any;
getAngularTestability: Function;
getAllAngularTestabilities: Function;
getAllAngularRootElements: Function;
frameworkStabilizers: Array<Function>;
setTimeout: Function;
clearTimeout: Function;
setInterval: Function;
clearInterval: Function;
encodeURI: Function;
}
export declare function scheduleMicroTask(fn: Function): void;
export declare const IS_DART: boolean;
declare var _global: BrowserNodeGlobal;
export { _global as global };
/**
* Runtime representation a type that a Component or other object is instances of.
*
* An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by
* the `MyCustomComponent` constructor function.
*
* @stable
*/
export declare var Type: FunctionConstructor;
export interface Type extends Function {
}
/**
* Runtime representation of a type that is constructable (non-abstract).
*/
export interface ConcreteType<T> extends Type {
new (...args: any[]): T;
}
export declare function getTypeNameForDebugging(type: Type): string;
export declare var Math: any;
export declare var Date: DateConstructor;
export declare function isPresent(obj: any): boolean;
export declare function isBlank(obj: any): boolean;
export declare function isBoolean(obj: any): boolean;
export declare function isNumber(obj: any): boolean;
export declare function isString(obj: any): obj is String;
export declare function isFunction(obj: any): boolean;
export declare function isType(obj: any): boolean;
export declare function isStringMap(obj: any): obj is Object;
export declare function isStrictStringMap(obj: any): boolean;
export declare function isPromise(obj: any): boolean;
export declare function isArray(obj: any): boolean;
export declare function isDate(obj: any): obj is Date;
export declare function noop(): void;
export declare function stringify(token: any): string;
export declare function serializeEnum(val: any): number;
export declare function deserializeEnum(val: any, values: Map<number, any>): any;
export declare function resolveEnumToken(enumValue: any, val: any): string;
export declare class StringWrapper {
static fromCharCode(code: number): string;
static charCodeAt(s: string, index: number): number;
static split(s: string, regExp: RegExp): string[];
static equals(s: string, s2: string): boolean;
static stripLeft(s: string, charVal: string): string;
static stripRight(s: string, charVal: string): string;
static replace(s: string, from: string, replace: string): string;
static replaceAll(s: string, from: RegExp, replace: string): string;
static slice<T>(s: string, from?: number, to?: number): string;
static replaceAllMapped(s: string, from: RegExp, cb: (m: string[]) => string): string;
static contains(s: string, substr: string): boolean;
static compare(a: string, b: string): number;
}
export declare class StringJoiner {
parts: string[];
constructor(parts?: string[]);
add(part: string): void;
toString(): string;
}
export declare class NumberParseError extends Error {
message: string;
name: string;
constructor(message: string);
toString(): string;
}
export declare class NumberWrapper {
static toFixed(n: number, fractionDigits: number): string;
static equal(a: number, b: number): boolean;
static parseIntAutoRadix(text: string): number;
static parseInt(text: string, radix: number): number;
static parseFloat(text: string): number;
static readonly NaN: number;
static isNumeric(value: any): boolean;
static isNaN(value: any): boolean;
static isInteger(value: any): boolean;
}
export declare var RegExp: RegExpConstructor;
export declare class RegExpWrapper {
static create(regExpStr: string, flags?: string): RegExp;
static firstMatch(regExp: RegExp, input: string): RegExpExecArray;
static test(regExp: RegExp, input: string): boolean;
static matcher(regExp: RegExp, input: string): {
re: RegExp;
input: string;
};
static replaceAll(regExp: RegExp, input: string, replace: Function): string;
}
export declare class RegExpMatcherWrapper {
static next(matcher: {
re: RegExp;
input: string;
}): RegExpExecArray;
}
export declare class FunctionWrapper {
static apply(fn: Function, posArgs: any): any;
static bind(fn: Function, scope: any): Function;
}
export declare function looseIdentical(a: any, b: any): boolean;
export declare function getMapKey<T>(value: T): T;
export declare function normalizeBlank(obj: Object): any;
export declare function normalizeBool(obj: boolean): boolean;
export declare function isJsObject(o: any): boolean;
export declare function print(obj: Error | Object): void;
export declare function warn(obj: Error | Object): void;
export declare class Json {
static parse(s: string): Object;
static stringify(data: Object): string;
}
export declare class DateWrapper {
static create(year: number, month?: number, day?: number, hour?: number, minutes?: number, seconds?: number, milliseconds?: number): Date;
static fromISOString(str: string): Date;
static fromMillis(ms: number): Date;
static toMillis(date: Date): number;
static now(): Date;
static toJson(date: Date): string;
}
export declare function setValueOnPath(global: any, path: string, value: any): void;
export declare function getSymbolIterator(): string | symbol;
export declare function evalExpression(sourceUrl: string, expr: string, declarations: string, vars: {
[key: string]: any;
}): any;
export declare function isPrimitive(obj: any): boolean;
export declare function hasConstructor(value: Object, type: Type): boolean;
export declare function escape(s: string): string;
export declare function escapeRegExp(s: string): string;
This diff is collapsed.
This diff is collapsed.
{"__symbolic":"module","version":1,"metadata":{"IS_DART":false,"Type":{"__symbolic":"reference","name":"Function"},"Math":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"_global"},"member":"Math"},"Date":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"_global"},"member":"Date"},"isPresent":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"undefined"}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isBoolean":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":106,"character":8},"right":"boolean"}},"isNumber":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":110,"character":8},"right":"number"}},"isString":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":114,"character":8},"right":"string"}},"isFunction":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":118,"character":8},"right":"function"}},"isType":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isFunction"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":126,"character":8},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"obj"},"right":null}}},"isStrictStringMap":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isStringMap"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"getPrototypeOf"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"right":{"__symbolic":"reference","name":"STRING_MAP_PROTO"}}}},"isPromise":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"_global"},"member":"Promise"}}},"isArray":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Array"},"member":"isArray"},"arguments":[{"__symbolic":"reference","name":"obj"}]}},"isDate":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"instanceof","left":{"__symbolic":"reference","name":"obj"},"right":{"__symbolic":"reference","name":"Date"}},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"obj"},"member":"valueOf"}}]}}}},"serializeEnum":{"__symbolic":"function","parameters":["val"],"value":{"__symbolic":"reference","name":"val"}},"deserializeEnum":{"__symbolic":"function","parameters":["val","values"],"value":{"__symbolic":"reference","name":"val"}},"resolveEnumToken":{"__symbolic":"function","parameters":["enumValue","val"],"value":{"__symbolic":"index","expression":{"__symbolic":"reference","name":"enumValue"},"index":{"__symbolic":"reference","name":"val"}}},"RegExp":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"_global"},"member":"RegExp"},"looseIdentical":{"__symbolic":"function","parameters":["a","b"],"value":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"reference","name":"a"},"right":{"__symbolic":"reference","name":"b"}},"right":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":366,"character":19},"right":"number"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":366,"character":44},"right":"number"}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"a"}]}},"right":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isNaN"},"arguments":[{"__symbolic":"reference","name":"b"}]}}}},"getMapKey":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"reference","name":"value"}},"normalizeBlank":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"error","message":"Expression form not supported","line":376,"character":8}},"normalizeBool":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"error","message":"Expression form not supported","line":380,"character":8}},"isJsObject":{"__symbolic":"function","parameters":["o"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"o"},"right":null},"right":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":384,"character":24},"right":"function"},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":384,"character":50},"right":"object"}}}},"isPrimitive":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"isJsObject"},"arguments":[{"__symbolic":"reference","name":"obj"}]}}},"hasConstructor":{"__symbolic":"function","parameters":["value","type"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"value"},"member":"constructor"},"right":{"__symbolic":"reference","name":"type"}}},"escape":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"_global"},"member":"encodeURI"},"arguments":[{"__symbolic":"reference","name":"s"}]}},"escapeRegExp":{"__symbolic":"function","parameters":["s"],"value":{"__symbolic":"error","message":"Expression form not supported","line":481,"character":19}}}}
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export declare class PromiseCompleter<R> {
promise: Promise<R>;
resolve: (value?: R | PromiseLike<R>) => void;
reject: (error?: any, stackTrace?: string) => void;
constructor();
}
export declare class PromiseWrapper {
static resolve<T>(obj: T): Promise<T>;
static reject(obj: any, _: any): Promise<any>;
static catchError<T>(promise: Promise<T>, onError: (error: any) => T | PromiseLike<T>): Promise<T>;
static all<T>(promises: (T | Promise<T>)[]): Promise<T[]>;
static then<T, U>(promise: Promise<T>, success: (value: T) => U | PromiseLike<U>, rejection?: (error: any, stack?: any) => U | PromiseLike<U>): Promise<U>;
static wrap<T>(computation: () => T): Promise<T>;
static scheduleMicrotask(computation: () => any): void;
static completer<T>(): PromiseCompleter<T>;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment