Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/angular2/src/core/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export {
} from './application_ref';

/// See [commonBootstrap] for detailed documentation.
export function bootstrap(appComponentType: /*Type*/ any,
appProviders: Array<Type | Provider | any[]> = null):
Promise<ComponentRef> {
export function bootstrap(
appComponentType: /*Type*/ any,
appProviders: Array<Type | Provider | any[]> = null): Promise<ComponentRef> {
var providers = [compilerProviders()];
if (isPresent(appProviders)) {
providers.push(appProviders);
Expand Down
6 changes: 3 additions & 3 deletions modules/angular2/src/core/application_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ export function platform(providers?: Array<Type | Provider | any[]>): PlatformRe
*
* Returns a `Promise` of {@link ComponentRef}.
*/
export function commonBootstrap(appComponentType: /*Type*/ any,
appProviders: Array<Type | Provider | any[]> = null):
Promise<ComponentRef> {
export function commonBootstrap(
appComponentType: /*Type*/ any,
appProviders: Array<Type | Provider | any[]> = null): Promise<ComponentRef> {
var p = platform();
var bindings = [applicationCommonProviders(), applicationDomProviders()];
if (isPresent(appProviders)) {
Expand Down
12 changes: 6 additions & 6 deletions modules/angular2/src/core/application_ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ export abstract class PlatformRef {
* new application. Once this promise resolves, the application will be
* constructed in the same manner as a normal `application()`.
*/
abstract asyncApplication(bindingFn: (zone: NgZone) => Promise<Array<Type | Provider | any[]>>):
Promise<ApplicationRef>;
abstract asyncApplication(bindingFn: (zone: NgZone) =>
Promise<Array<Type | Provider | any[]>>): Promise<ApplicationRef>;

/**
* Destroy the Angular platform and all Angular applications on the page.
Expand All @@ -228,8 +228,8 @@ export class PlatformRef_ extends PlatformRef {
return app;
}

asyncApplication(bindingFn: (zone: NgZone) =>
Promise<Array<Type | Provider | any[]>>): Promise<ApplicationRef> {
asyncApplication(bindingFn: (zone: NgZone) => Promise<Array<Type | Provider | any[]>>):
Promise<ApplicationRef> {
var zone = createNgZone();
var completer = PromiseWrapper.completer();
zone.run(() => {
Expand Down Expand Up @@ -314,8 +314,8 @@ export abstract class ApplicationRef {
* app.bootstrap(SecondRootComponent, [provide(OverrideBinding, {useClass: OverriddenBinding})]);
* ```
*/
abstract bootstrap(componentType: Type, providers?: Array<Type | Provider | any[]>):
Promise<ComponentRef>;
abstract bootstrap(componentType: Type,
providers?: Array<Type | Provider | any[]>): Promise<ComponentRef>;

/**
* Retrieve the application {@link Injector}.
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/change_detection/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export var CHANGE_DETECTION_STRATEGY_VALUES = [
ChangeDetectionStrategy.OnPushObserve
];

export function isDefaultChangeDetectionStrategy(changeDetectionStrategy: ChangeDetectionStrategy):
boolean {
export function isDefaultChangeDetectionStrategy(
changeDetectionStrategy: ChangeDetectionStrategy): boolean {
return isBlank(changeDetectionStrategy) ||
changeDetectionStrategy === ChangeDetectionStrategy.Default;
}
4 changes: 2 additions & 2 deletions modules/angular2/src/core/compiler/command_compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ class CodegenCommandFactory implements CommandFactory<string> {
}
}

function visitAndReturnContext(visitor: TemplateAstVisitor, asts: TemplateAst[], context: any):
any {
function visitAndReturnContext(visitor: TemplateAstVisitor, asts: TemplateAst[],
context: any): any {
templateVisitAll(visitor, asts, context);
return context;
}
Expand Down
3 changes: 2 additions & 1 deletion modules/angular2/src/core/compiler/directive_metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ export class CompileDirectiveMetadata {
hostListeners: hostListeners,
hostProperties: hostProperties,
hostAttributes: hostAttributes,
lifecycleHooks: isPresent(lifecycleHooks) ? lifecycleHooks : [], template: template
lifecycleHooks: isPresent(lifecycleHooks) ? lifecycleHooks : [],
template: template
});
}

Expand Down
8 changes: 4 additions & 4 deletions modules/angular2/src/core/compiler/html_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ function parseText(text: Text, indexInParent: number, parentSourceInfo: string):
`${parentSourceInfo} > #text(${value}):nth-child(${indexInParent})`);
}

function parseAttr(element: Element, parentSourceInfo: string, attrName: string, attrValue: string):
HtmlAttrAst {
function parseAttr(element: Element, parentSourceInfo: string, attrName: string,
attrValue: string): HtmlAttrAst {
// TODO(tbosch): add source row/column source info from parse5 / package:html
var lowerCaseAttrName = attrName.toLowerCase();
return new HtmlAttrAst(lowerCaseAttrName, attrValue,
`${parentSourceInfo}[${lowerCaseAttrName}=${attrValue}]`);
}

function parseElement(element: Element, indexInParent: number, parentSourceInfo: string):
HtmlElementAst {
function parseElement(element: Element, indexInParent: number,
parentSourceInfo: string): HtmlElementAst {
// normalize nodename always as lower case so that following build steps
// can rely on this
var nodeName = DOM.nodeName(element).toLowerCase();
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/compiler/style_url_resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export function isStyleUrlResolvable(url: string): boolean {
* Rewrites stylesheets by resolving and removing the @import urls that
* are either relative or don't have a `package:` scheme
*/
export function extractStyleUrls(resolver: UrlResolver, baseUrl: string, cssText: string):
StyleWithImports {
export function extractStyleUrls(resolver: UrlResolver, baseUrl: string,
cssText: string): StyleWithImports {
var foundUrls = [];
var modifiedCssText = StringWrapper.replaceAllMapped(cssText, _cssImportRe, (m) => {
var url = isPresent(m[1]) ? m[1] : m[2];
Expand Down
7 changes: 4 additions & 3 deletions modules/angular2/src/core/compiler/template_compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export class TemplateCompiler {
this._appId = appId;
}

normalizeDirectiveMetadata(directive:
CompileDirectiveMetadata): Promise<CompileDirectiveMetadata> {
normalizeDirectiveMetadata(directive: CompileDirectiveMetadata):
Promise<CompileDirectiveMetadata> {
if (!directive.isComponent) {
// For non components there is nothing to be normalized yet.
return PromiseWrapper.resolve(directive);
Expand All @@ -70,7 +70,8 @@ export class TemplateCompiler {
hostListeners: directive.hostListeners,
hostProperties: directive.hostProperties,
hostAttributes: directive.hostAttributes,
lifecycleHooks: directive.lifecycleHooks, template: normalizedTemplate
lifecycleHooks: directive.lifecycleHooks,
template: normalizedTemplate
}));
}

Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/di/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,8 @@ function _extractToken(typeOrFunc, metadata /*any[] | any*/, params: any[][]): D
}
}

function _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility, depProps):
Dependency {
function _createDependency(token, optional, lowerBoundVisibility, upperBoundVisibility,
depProps): Dependency {
return new Dependency(Key.get(token), optional, lowerBoundVisibility, upperBoundVisibility,
depProps);
}
5 changes: 3 additions & 2 deletions modules/angular2/src/core/facade/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ var _clearValues: {(m: Map<any, any>)} = (function() {
var _arrayFromMap: {(m: Map<any, any>, getValues: boolean): any[]} = (function() {
try {
if ((<any>(new Map()).values()).next) {
return function createArrayFromMap(m: Map<any, any>, getValues: boolean):
any[] { return getValues ? (<any>Array).from(m.values()) : (<any>Array).from(m.keys()); };
return function createArrayFromMap(m: Map<any, any>, getValues: boolean): any[] {
return getValues ? (<any>Array).from(m.values()) : (<any>Array).from(m.keys());
};
}
} catch (e) {
}
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/forms/directives/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export function isPropertyUpdated(changes: {[key: string]: any}, viewModel: any)
}

// TODO: vsavkin remove it once https://github.com/angular/angular/issues/3011 is implemented
export function selectValueAccessor(dir: NgControl, valueAccessors: ControlValueAccessor[]):
ControlValueAccessor {
export function selectValueAccessor(dir: NgControl,
valueAccessors: ControlValueAccessor[]): ControlValueAccessor {
if (isBlank(valueAccessors)) return null;

var defaultAccessor;
Expand Down
13 changes: 7 additions & 6 deletions modules/angular2/src/core/forms/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export abstract class AbstractControl {

setParent(parent: ControlGroup | ControlArray): void { this._parent = parent; }

updateValueAndValidity({onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}):
void {
updateValueAndValidity(
{onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {
onlySelf = normalizeBool(onlySelf);
emitEvent = isPresent(emitEvent) ? emitEvent : true;

Expand Down Expand Up @@ -237,10 +237,11 @@ export class Control extends AbstractControl {
* via an `onChange` event. This is the default behavior if `emitModelToViewChange` is not
* specified.
*/
updateValue(value: any,
{onlySelf, emitEvent, emitModelToViewChange}:
{onlySelf?: boolean, emitEvent?: boolean, emitModelToViewChange?: boolean} = {}):
void {
updateValue(value: any, {onlySelf, emitEvent, emitModelToViewChange}: {
onlySelf?: boolean,
emitEvent?: boolean,
emitModelToViewChange?: boolean
} = {}): void {
emitModelToViewChange = isPresent(emitModelToViewChange) ? emitModelToViewChange : true;
this._value = value;
if (isPresent(this._onChange) && emitModelToViewChange) this._onChange(this._value);
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/linker/dynamic_component_loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ export abstract class DynamicComponentLoader {
* <child-component>Child</child-component>
* ```
*/
abstract loadNextToLocation(type: Type, location: ElementRef, providers?: ResolvedProvider[]):
Promise<ComponentRef>;
abstract loadNextToLocation(type: Type, location: ElementRef,
providers?: ResolvedProvider[]): Promise<ComponentRef>;
}

@Injectable()
Expand Down
6 changes: 3 additions & 3 deletions modules/angular2/src/core/linker/proto_view_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ function provideDirective(directiveResolver: DirectiveResolver, type: Type): Dir
return DirectiveProvider.createFromType(type, annotation);
}

export function createDirectiveVariableBindings(variableNameAndValues: Array<string | number>,
directiveProviders: DirectiveProvider[]):
Map<string, number> {
export function createDirectiveVariableBindings(
variableNameAndValues: Array<string | number>,
directiveProviders: DirectiveProvider[]): Map<string, number> {
var directiveVariableBindings = new Map<string, number>();
for (var i = 0; i < variableNameAndValues.length; i += 2) {
var templateName = <string>variableNameAndValues[i];
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/linker/template_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ export class EmbeddedTemplateCmd implements TemplateCmd, IBeginElementCmd,

export function embeddedTemplate(attrNameAndValues: string[], variableNameAndValues: string[],
directives: Type[], isMerged: boolean, ngContentIndex: number,
changeDetectorFactory: Function, children: TemplateCmd[]):
EmbeddedTemplateCmd {
changeDetectorFactory: Function,
children: TemplateCmd[]): EmbeddedTemplateCmd {
return new EmbeddedTemplateCmd(attrNameAndValues, variableNameAndValues, directives, isMerged,
ngContentIndex, changeDetectorFactory, children);
}
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/linker/view_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export abstract class AppViewManager {
* Throws an exception if the specified `hostLocation` is not a Host Element of a Component, or if
* variable `variableName` couldn't be found in the Component View of this Component.
*/
abstract getNamedElementInComponentView(hostLocation: ElementRef, variableName: string):
ElementRef;
abstract getNamedElementInComponentView(hostLocation: ElementRef,
variableName: string): ElementRef;

/**
* Returns the component instance for the provided Host Element.
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/render/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ export abstract class Renderer {
*
* Returns an instance of {@link RenderViewWithFragments}, representing the Render View.
*/
abstract createView(protoViewRef: RenderProtoViewRef, fragmentCount: number):
RenderViewWithFragments;
abstract createView(protoViewRef: RenderProtoViewRef,
fragmentCount: number): RenderViewWithFragments;

/**
* Destroys a Render View specified via `viewRef`.
Expand Down
8 changes: 4 additions & 4 deletions modules/angular2/src/core/render/dom/dom_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ export abstract class DomRenderer extends Renderer implements NodeFactory<Node>
abstract createRootHostView(hostProtoViewRef: RenderProtoViewRef, fragmentCount: number,
hostElementSelector: string): RenderViewWithFragments;

abstract createView(protoViewRef: RenderProtoViewRef, fragmentCount: number):
RenderViewWithFragments;
abstract createView(protoViewRef: RenderProtoViewRef,
fragmentCount: number): RenderViewWithFragments;

abstract destroyView(viewRef: RenderViewRef);

Expand Down Expand Up @@ -207,8 +207,8 @@ export abstract class DomRenderer extends Renderer implements NodeFactory<Node>
propertyValue);
}

setElementAttribute(location: RenderElementRef, attributeName: string, attributeValue: string):
void {
setElementAttribute(location: RenderElementRef, attributeName: string,
attributeValue: string): void {
var view = resolveInternalDomView(location.renderView);
var element = view.boundElements[location.boundElementIndex];
var dashCasedAttributeName = camelCaseToDashCase(attributeName);
Expand Down
18 changes: 9 additions & 9 deletions modules/angular2/src/core/testability/browser_testability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export class BrowserGetTestability implements GetTestability {
static init() { setTestabilityGetter(new BrowserGetTestability()); }

addToWindow(registry: TestabilityRegistry): void {
global.getAngularTestability = function(elem: Element, findInAncestors: boolean = true):
PublicTestability {
var testability = registry.findTestabilityInTree(elem, findInAncestors);

if (testability == null) {
throw new Error('Could not find testability for element.');
}
return new PublicTestability(testability);
};
global.getAngularTestability = function(elem: Element,
findInAncestors: boolean = true): PublicTestability {
var testability = registry.findTestabilityInTree(elem, findInAncestors);

if (testability == null) {
throw new Error('Could not find testability for element.');
}
return new PublicTestability(testability);
};
global.getAllAngularTestabilities = function(): PublicTestability[] {
var testabilities = registry.getAllTestabilities();
return testabilities.map((testability) => { return new PublicTestability(testability); });
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/core/util/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ if (!(Reflect && Reflect.getMetadata)) {
throw 'reflect-metadata shim is required when using class decorators';
}

export function makeDecorator(annotationCls, chainFn: (fn: Function) => void = null):
(...args: any[]) => (cls: any) => any {
export function makeDecorator(
annotationCls, chainFn: (fn: Function) => void = null): (...args: any[]) => (cls: any) => any {
function DecoratorFactory(objOrType): (cls: any) => any {
var annotationInstance = new (<any>annotationCls)(objOrType);
if (this instanceof annotationCls) {
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/http/backends/mock_backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Connection, ConnectionBackend} from '../interfaces';
import {isPresent} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions';
var Rx = require('@reactivex/rxjs/dist/cjs/Rx');
let{Subject, ReplaySubject} = Rx;
let {Subject, ReplaySubject} = Rx;

/**
*
Expand Down
6 changes: 3 additions & 3 deletions modules/angular2/src/router/lifecycle_annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ export {
*
* {@example router/ts/can_activate/can_activate_example.ts region='canActivate' }
*/
export var CanActivate:
(hook: (next: ComponentInstruction, prev: ComponentInstruction) => Promise<boolean>| boolean) =>
ClassDecorator = makeDecorator(CanActivateAnnotation);
export var CanActivate: (hook: (next: ComponentInstruction, prev: ComponentInstruction) =>
Promise<boolean>| boolean) => ClassDecorator =
makeDecorator(CanActivateAnnotation);
8 changes: 4 additions & 4 deletions modules/angular2/src/router/route_config_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export class Route implements RouteDefinition {
// added next two properties to work around https://github.com/Microsoft/TypeScript/issues/4107
loader: Function;
redirectTo: string;
constructor({path, component, as, data}:
{path: string, component: Type, as?: string, data?: {[key: string]: any}}) {
constructor({path, component, as,
data}: {path: string, component: Type, as?: string, data?: {[key: string]: any}}) {
this.path = path;
this.component = component;
this.as = as;
Expand Down Expand Up @@ -115,8 +115,8 @@ export class AsyncRoute implements RouteDefinition {
path: string;
loader: Function;
as: string;
constructor({path, loader, as, data}:
{path: string, loader: Function, as?: string, data?: {[key: string]: any}}) {
constructor({path, loader, as,
data}: {path: string, loader: Function, as?: string, data?: {[key: string]: any}}) {
this.path = path;
this.loader = loader;
this.as = as;
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ function splitAndFlattenLinkParams(linkParams: any[]): any[] {
}, []);
}

function canActivateOne(nextInstruction: Instruction, prevInstruction: Instruction):
Promise<boolean> {
function canActivateOne(nextInstruction: Instruction,
prevInstruction: Instruction): Promise<boolean> {
var next = _resolveToTrue;
if (isPresent(nextInstruction.child)) {
next = canActivateOne(nextInstruction.child,
Expand Down
Loading