fix(api): align dart/js APIs

This commit is contained in:
Misko Hevery
2015-09-21 16:48:16 -07:00
parent 577ee3744a
commit af2cd4d6f3
14 changed files with 1264 additions and 672 deletions

View File

@ -1,4 +1,11 @@
// Public API for Application
export {APP_COMPONENT} from './application_tokens';
export {platform, commonBootstrap as bootstrap} from './application_common';
export {PlatformRef, ApplicationRef} from './application_ref';
export {
PlatformRef,
ApplicationRef,
applicationCommonBindings,
createNgZone,
platformCommon,
platformBindings
} from './application_ref';

View File

@ -1,11 +0,0 @@
library angular2.src.core.directives;
export './directives/ng_class.dart';
export './directives/ng_for.dart';
export './directives/ng_if.dart';
export './directives/ng_non_bindable.dart';
export './directives/ng_style.dart';
export './directives/ng_switch.dart';
//Dart Only
export './directives/observable_list_diff.dart';

View File

@ -12,12 +12,14 @@ import {NgNonBindable} from './directives/ng_non_bindable';
import {NgStyle} from './directives/ng_style';
import {NgSwitch, NgSwitchWhen, NgSwitchDefault} from './directives/ng_switch';
export * from './directives/ng_class';
export * from './directives/ng_for';
export * from './directives/ng_if';
export * from './directives/ng_non_bindable';
export * from './directives/ng_style';
export * from './directives/ng_switch';
export {NgClass} from './directives/ng_class';
export {NgFor} from './directives/ng_for';
export {NgIf} from './directives/ng_if';
export {NgNonBindable} from './directives/ng_non_bindable';
export {NgStyle} from './directives/ng_style';
export {NgSwitch, NgSwitchWhen, NgSwitchDefault} from './directives/ng_switch';
export * from './directives/observable_list_diff';
/**
* A collection of the Angular core directives that are likely to be used in each and every Angular

View File

@ -0,0 +1,4 @@
// TS does not have Observables
// I need to be here to make TypeScript think this is a module.
import {} from 'angular2/src/core/facade/lang';

View File

@ -9,7 +9,7 @@ export const DOCUMENT: OpaqueToken = CONST_EXPR(new OpaqueToken('DocumentToken')
export const APP_ID: OpaqueToken = CONST_EXPR(new OpaqueToken('AppId'));
function _appIdRandomBindingFactory() {
return `${randomChar()}${randomChar()}${randomChar()}`;
return `${_randomChar()}${_randomChar()}${_randomChar()}`;
}
/**
@ -25,6 +25,6 @@ export const APP_ID_RANDOM_BINDING: Binding =
export const MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE: OpaqueToken =
CONST_EXPR(new OpaqueToken('MaxInMemoryElementsPerTemplate'));
function randomChar(): string {
function _randomChar(): string {
return StringWrapper.fromCharCode(97 + Math.floor(Math.random() * 25));
}