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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ tags
!/nativescript-angular/postinstall.js
!/nativescript-angular/hooks/**/*.js
!/nativescript-angular/gulpfile.js
!/nativescript-angular/rollup.config.js
!/nativescript-angular/rollup-entry.js
!/nativescript-angular/zone-js/**/*.js

.tscache
Expand Down
2 changes: 1 addition & 1 deletion nativescript-angular/global.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/// <reference path="./node_modules/tns-core-modules/tns-core-modules.es6.d.ts" />
/// <reference path="./node_modules/tns-core-modules/tns-core-modules.d.ts" />
12 changes: 11 additions & 1 deletion nativescript-angular/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,15 @@ export * from "./renderer";
export * from "./view-util";
export * from "./animation-driver";
export * from "./resource-loader";
export * from "./element-registry";
export {
ViewResolver,
TEMPLATE,
ViewClass,
ViewClassMeta,
registerElement,
getViewClass,
getViewMeta,
isKnownView,
TemplateView
} from "./element-registry";
export * from "./value-accessors/base-value-accessor";
2 changes: 0 additions & 2 deletions nativescript-angular/initial-imports.js

This file was deleted.

15 changes: 5 additions & 10 deletions nativescript-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"private": true,
"name": "nativescript-angular",
"version": "1.3.0",
"main": "bundle.all.js",
"module": "index.js",
"typings": "index.d.ts",
"description": "An Angular 2 renderer that lets you build mobile apps with NativeScript.",
"homepage": "http://www.telerik.com",
"bugs": "http://www.telerik.com",
Expand All @@ -21,10 +18,10 @@
"postinstall": "node postinstall.js",
"ngc": "ngc -p tsconfig.json",
"tsc": "tsc -p tsconfig.json",
"prepublish": "npm run tsc && rollup -c && npm run ngc"
"prepublish": "npm run tsc && npm run ngc"
},
"dependencies": {
"nativescript-intl": "~0.0.5",
"nativescript-intl": "~0.0.8",
"@angular/core": "~2.2.1",
"@angular/common": "~2.2.1",
"@angular/compiler": "~2.2.1",
Expand All @@ -38,18 +35,16 @@
"parse5": "1.3.2",
"punycode": "1.3.2",
"querystring": "0.2.0",
"rxjs": "5.0.0-beta.12",
"url": "0.10.3"
},
"devDependencies": {
"tns-core-modules": ">=2.5.0 || >=2.5.0-2016",
"zone.js": "^0.6.21",
"typescript": "~2.0.10",
"tslint": "~4.0.1",
"codelyzer": "^2.0.0-beta.1",
"@angular/compiler-cli": "~2.2.1",
"rollup": "^0.36.3",
"rollup-plugin-multi-entry": "^2.0.1"
"codelyzer": "^2.0.0-beta.1",
"tns-core-modules": ">=2.5.0 || >=2.5.0-2016",
"zone.js": "^0.6.21"
},
"nativescript": {}
}
12 changes: 0 additions & 12 deletions nativescript-angular/rollup-entry.js

This file was deleted.

22 changes: 0 additions & 22 deletions nativescript-angular/rollup.config.js

This file was deleted.

3 changes: 1 addition & 2 deletions nativescript-angular/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import { NSLocationStrategy, LocationState } from "./router/ns-location-strategy
import { NativescriptPlatformLocation } from "./router/ns-platform-location";
import { RouterExtensions } from "./router/router-extensions";
import { NativeScriptModule } from "./nativescript.module";
export { NSModuleFactoryLoader } from "./router/ns-module-factory-loader";

export { PageRoute } from "./router/page-router-outlet";
export { RouterExtensions } from "./router/router-extensions";
export { NSLocationStrategy } from "./router/ns-location-strategy";
export { NSModuleFactoryLoader } from "./router/ns-module-factory-loader";
export type LocationState = LocationState;

@NgModule({
Expand Down
4 changes: 2 additions & 2 deletions nativescript-angular/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es6",
"module": "es6",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
Expand Down
2 changes: 2 additions & 0 deletions nativescript-angular/view-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const IOS_PREFX: string = ":ios:";
const ANDROID_PREFX: string = ":android:";
const whiteSpaceSplitter = /\s+/;

export type ViewExtensions = ViewExtensions;
export type NgView = NgView;
export type NgLayoutBase = LayoutBase & ViewExtensions;
export type NgContentView = ContentView & ViewExtensions;
export type BeforeAttachAction = (view: View) => void;
Expand Down
58 changes: 25 additions & 33 deletions ng-sample/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,15 @@
//profiling.start("application-start");

// "nativescript-angular/application" import should be first in order to load some required settings (like globals and reflect-metadata)
import {
NativeScriptModule,
platformNativeScriptDynamic,
NativeScriptRouterModule,
NativeScriptFormsModule,
NativeScriptHttpModule,
routerTraceCategory,
rendererTraceCategory,
listViewTraceCategory,
PAGE_FACTORY,
PageFactory,
PageFactoryOptions,
onAfterLivesync,
onBeforeLivesync
} from "nativescript-angular";
import { NativeScriptModule, platformNativeScriptDynamic } from "nativescript-angular/platform";
import { onAfterLivesync, onBeforeLivesync } from "nativescript-angular/platform-common";
import { NgModule } from "@angular/core";
import { Router } from "@angular/router";
import { NativeScriptRouterModule } from "nativescript-angular/router";
import { NativeScriptFormsModule } from "nativescript-angular/forms";
import { NativeScriptHttpModule } from "nativescript-angular/http";
import { rendererTraceCategory, routerTraceCategory, listViewTraceCategory } from "nativescript-angular/trace";
import { PAGE_FACTORY, PageFactory, PageFactoryOptions } from "nativescript-angular/platform-providers";
import { Page } from "ui/page";
import { Color } from "color";
import { setCategories, enable } from "trace";
Expand Down Expand Up @@ -146,24 +138,24 @@ platformNativeScriptDynamic().bootstrapModule(makeExampleModule(RendererTest));
// platformNativeScriptDynamic().bootstrapModule(makeExampleModule(AnimationEnterLeaveTest));

//Livesync test
//var cachedUrl: string;
//onBeforeLivesync.subscribe((moduleRef) => {
// console.log("------- onBeforeLivesync");
// if (moduleRef) {
// const router = <Router>moduleRef.injector.get(Router);
// cachedUrl = router.url;
// console.log("------- Caching URL: " + cachedUrl);
// }
//});
//
//onAfterLivesync.subscribe((moduleRef) => {
// console.log("------- onAfterLivesync cachedUrl:");
// const router = <Router>moduleRef.injector.get(Router);
// router.events.subscribe(e => console.log(e.toString()));
// if (router && cachedUrl) {
// setTimeout(() => { router.navigateByUrl(cachedUrl); }, 0);
// }
//});
var cachedUrl: string;
onBeforeLivesync.subscribe((moduleRef) => {
console.log("------- onBeforeLivesync");
if (moduleRef) {
const router = <Router>moduleRef.injector.get(Router);
cachedUrl = router.url;
console.log("------- Caching URL: " + cachedUrl);
}
});

onAfterLivesync.subscribe((moduleRef) => {
console.log("------- onAfterLivesync cachedUrl:");
const router = <Router>moduleRef.injector.get(Router);
router.events.subscribe(e => console.log(e.toString()));
if (router && cachedUrl) {
setTimeout(() => { router.navigateByUrl(cachedUrl); }, 0);
}
});

//platformNativeScriptDynamic().bootstrapModule(makeExampleModule(LivesyncApp));
console.log("APP RESTART");
7 changes: 4 additions & 3 deletions ng-sample/app/examples/renderer-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Component, Directive, Host, ElementRef, Input} from "@angular/core";
import {Observable} from "data/observable";
import { TextValueAccessor, CheckedValueAccessor } from "nativescript-angular";
import {Component, Directive, Host, ElementRef, Input} from '@angular/core';
import {Observable} from 'data/observable';
import {TextValueAccessor} from 'nativescript-angular/value-accessors/text-value-accessor';
import {CheckedValueAccessor} from 'nativescript-angular/value-accessors/checked-value-accessor';

@Component({
moduleId: module.id,
Expand Down
1 change: 1 addition & 0 deletions ng-sample/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"module": "commonjs",
"moduleResolution": "node",
"target": "es5",
"inlineSourceMap": true,
"experimentalDecorators": true,
"removeComments": false,
"emitDecoratorMetadata": true,
Expand Down
3 changes: 2 additions & 1 deletion tests/app/lazy-loaded.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NgModule } from '@angular/core';
import { NativeScriptModule, NativeScriptRouterModule } from "nativescript-angular";
import { NativeScriptModule } from "nativescript-angular";
import { NativeScriptRouterModule } from "nativescript-angular/router";

import { SecondComponent } from './second.component';

Expand Down
17 changes: 7 additions & 10 deletions tests/app/main.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import {
NativeScriptModule,
platformNativeScriptDynamic,
rendererTraceCategory,
routerTraceCategory,
NativeScriptRouterModule,
NativeScriptFormsModule,
NSModuleFactoryLoader,
APP_ROOT_VIEW
} from "nativescript-angular";
// "nativescript-angular/platform" import should be first in order to load some required settings (like globals and reflect-metadata)
import { NativeScriptModule, platformNativeScriptDynamic } from "nativescript-angular/platform";
import { NativeScriptRouterModule, NSModuleFactoryLoader } from "nativescript-angular/router";
import { NativeScriptFormsModule } from "nativescript-angular/forms";
import { AppComponent } from "./app.component";
import { GestureComponent } from "./snippets/gestures.component";
import { LayoutsComponent } from "./snippets/layouts.component";
import { IconFontComponent } from "./snippets/icon-font.component";
import { APP_ROOT_VIEW } from "nativescript-angular/platform-providers";
import { Page } from "ui/page";
import { StackLayout } from "ui/layouts/stack-layout";

Expand All @@ -29,6 +24,8 @@ import { OpaqueToken, NgModule, NgModuleFactoryLoader } from "@angular/core";
import { PageNavigationApp } from "./snippets/navigation/page-outlet";
import { NavigationApp } from "./snippets/navigation/router-outlet";

import { rendererTraceCategory, routerTraceCategory } from "nativescript-angular/trace";

import { BehaviorSubject } from "rxjs";

import trace = require("trace");
Expand Down
4 changes: 2 additions & 2 deletions tests/app/snippets/navigation/config-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const routes = [
// << router-config

// >> router-provider
import { NativeScriptRouterModule } from "nativescript-angular";
import { NativeScriptRouterModule } from "nativescript-angular/router";

@NgModule({
bootstrap: [GroceriesApp],
Expand All @@ -27,7 +27,7 @@ export class GroceriesAppModule { }
// << router-provider

// >> router-bootstrap
import { platformNativeScriptDynamic } from "nativescript-angular";
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
// >> (hide)
function start_snippet() {
// << (hide)
Expand Down
3 changes: 2 additions & 1 deletion tests/app/snippets/navigation/page-outlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { TestApp, registerTestApp } from "../../tests/test-app";
import { ApplicationRef } from '@angular/core';
import { Router, NavigationStart, NavigationEnd } from "@angular/router";
// >> page-outlet-example
import { platformNativeScriptDynamic, NativeScriptModule, NativeScriptRouterModule } from "nativescript-angular";
import { platformNativeScriptDynamic, NativeScriptModule } from "nativescript-angular/platform";
import { Component, NgModule } from '@angular/core';
import { NativeScriptRouterModule } from "nativescript-angular/router";
import { routes } from "./app.routes";
import { FirstComponent, SecondComponent } from "./navigation-common";

Expand Down
2 changes: 1 addition & 1 deletion tests/app/snippets/navigation/route-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MyComponent {


// >> router-params-page-route
import { PageRoute } from "nativescript-angular";
import { PageRoute } from "nativescript-angular/router";
class MyPageComponent {
id: number;
constructor(private pageRoute: PageRoute) {
Expand Down
2 changes: 1 addition & 1 deletion tests/app/snippets/navigation/router-extensions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from "@angular/core";
import { RouterExtensions } from 'nativescript-angular';
import { RouterExtensions } from 'nativescript-angular/router';

@Component({
// ...
Expand Down
3 changes: 2 additions & 1 deletion tests/app/snippets/navigation/router-outlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {TestApp, registerTestApp} from "../../tests/test-app";
import { ApplicationRef } from '@angular/core';
// >> router-outlet-example
import { Component, NgModule } from '@angular/core';
import { platformNativeScriptDynamic, NativeScriptRouterModule } from "nativescript-angular";
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
import { NativeScriptRouterModule } from "nativescript-angular/router";
import { Router, NavigationStart, NavigationEnd } from '@angular/router';
import { routes } from "./app.routes";
import {FirstComponent, SecondComponent} from "./navigation-common";
Expand Down
2 changes: 1 addition & 1 deletion tests/app/tests/detached-loader-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {Red} from "color/known-colors";
import {dumpView} from "./test-utils";
import {LayoutBase} from "ui/layouts/layout-base";
import {StackLayout} from "ui/layouts/stack-layout";
import {DetachedLoader} from "nativescript-angular";
import {DetachedLoader} from "nativescript-angular/common/detached-loader";

@Component({
template: `<StackLayout><Label text="COMPONENT"></Label></StackLayout>`
Expand Down
3 changes: 2 additions & 1 deletion tests/app/tests/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {ReflectiveInjector} from '@angular/core';
import {BaseRequestOptions, ConnectionBackend, Http, Response, ResponseOptions} from '@angular/http';
import 'rxjs/add/operator/map';
import {MockBackend} from '@angular/http/testing';
import { NSHttp, NSFileSystem } from "nativescript-angular";
import {NSHttp} from "nativescript-angular/http/ns-http";
import {NSFileSystem} from "nativescript-angular/file-system/ns-file-system";
import {NSFileSystemMock, FileResponses} from './mocks/ns-file-system.mock';

describe("Http", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/app/tests/modal-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TestApp } from "./test-app";
import { Component, ViewContainerRef } from "@angular/core";
import { Page } from "ui/page";
import { topmost } from "ui/frame";
import { ModalDialogParams, ModalDialogService } from "nativescript-angular";
import { ModalDialogParams, ModalDialogService } from "nativescript-angular/directives/dialogs";

import { device, platformNames } from "platform";
const CLOSE_WAIT = (device.os === platformNames.ios) ? 1000 : 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/app/tests/ns-location-strategy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//make sure you import mocha-config before @angular/core
import {assert} from "./test-config";
import {NSLocationStrategy, LocationState} from "nativescript-angular";
import {NSLocationStrategy, LocationState} from "nativescript-angular/router/ns-location-strategy";
import {Frame, BackstackEntry, NavigationEntry} from "ui/frame";
import {Page} from "ui/page";
import {View} from "ui/core/view";
Expand Down
2 changes: 1 addition & 1 deletion tests/app/tests/platform-filter-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { assert } from "./test-config";
import { Component, ElementRef } from "@angular/core";
import { dumpView, createDevice } from "./test-utils";
import { TestApp } from "./test-app";
import { DEVICE } from "nativescript-angular";
import { DEVICE } from "nativescript-angular/platform-providers";
import { platformNames } from "platform";

@Component({
Expand Down
3 changes: 2 additions & 1 deletion tests/app/tests/property-sets.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//make sure you import mocha-config before @angular/core
import {assert} from "./test-config";
import {View} from "ui/core/view";
import {ViewUtil, NgView, ViewExtensions, ViewClassMeta} from "nativescript-angular";
import {ViewUtil} from "nativescript-angular/view-util";
import {NgView, ViewExtensions, ViewClassMeta} from "nativescript-angular/element-registry";
import {Red} from "color/known-colors";
import {device, platformNames} from "platform";
import {createDevice} from "./test-utils";
Expand Down
2 changes: 1 addition & 1 deletion tests/app/tests/renderer-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { LayoutBase } from "ui/layouts/layout-base";
import { StackLayout } from "ui/layouts/stack-layout";
import { ContentView } from "ui/content-view";
import { Button } from "ui/button";
import { NgView } from "nativescript-angular";
import { NgView } from "nativescript-angular/element-registry";

@Component({
template: `<StackLayout><Label text="Layout"></Label></StackLayout>`
Expand Down
Loading