-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b45e007
commit 91fcad9
Showing
21 changed files
with
487 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,6 @@ | |
/**/.rts2_cache_cjs | ||
/**/.rts2_cache_es | ||
/**/.rts2_cache_umd | ||
/**/node_modules | ||
/**/node_modules | ||
/app | ||
/hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
import { Page } from 'nger-core'; | ||
import { Table } from 'nger-ui' | ||
import { NgerTodoAdminHome } from './index.controller' | ||
@Page({ | ||
path: 'task/list', | ||
type: 'admin', | ||
type: ['admin'], | ||
title: '任务', | ||
styleUrls: ['./index.scss'] | ||
}) | ||
export class NgerTodoTaskListPage { | ||
constructor(public controller: NgerTodoAdminHome) { } | ||
render() { | ||
return <Table onEditor={this.controller.onEditor} source={this.controller.getTasks()} /> | ||
} | ||
render() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"appResourcesPath": "app/App_Resources", | ||
"appPath": "app" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import { Cache } from 'nger-core' | ||
export class NgerH5Cache extends Cache { | ||
get<T>(key: string): Promise<T> { } | ||
put<T>(key: string, value: T): Promise<boolean> { } | ||
remove<T>(key: string): Promise<boolean> { } | ||
get<T>(key: string): Promise<T> { | ||
return new Promise(() => { }) | ||
} | ||
put<T>(key: string, value: T): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
remove<T>(key: string): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
clear(): void { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
import { Router } from 'nger-core' | ||
export class NgerH5Router extends Router { | ||
// 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 | ||
switchTab(url: string): Promise<boolean> { } | ||
switchTab(url: string): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
// 关闭所有页面,打开到应用内的某个页面 | ||
reLaunch(url: string): Promise<boolean> { } | ||
reLaunch(url: string): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
// 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 | ||
redirectTo(url: string): Promise<boolean> { } | ||
redirectTo(url: string): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
// 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面 | ||
navigateTo(url: string): Promise<boolean> { } | ||
async navigateTo(url: string): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
// 关闭当前页面,返回上一页面或多级页面 | ||
navigateBack(delta: number): Promise<boolean> { } | ||
navigateBack(delta: number): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { ContentView } from "tns-core-modules/ui/content-view"; | ||
import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; | ||
import { ProxyViewContainer } from "tns-core-modules/ui/proxy-view-container"; | ||
import { View } from "tns-core-modules/ui/core/view"; | ||
|
||
export class AppHostView extends ContentView { | ||
private _ngAppRoot: View; | ||
private _content: View; | ||
get ngAppRoot(): View { | ||
return this._ngAppRoot; | ||
} | ||
set ngAppRoot(value: View) { | ||
this._ngAppRoot = value; | ||
} | ||
get content(): View { | ||
return this._content; | ||
} | ||
set content(value: View) { | ||
if (this._content) { | ||
this._content.parentNode = undefined as any; | ||
} | ||
this._content = value; | ||
if (value) { | ||
this._content.parentNode = this; | ||
} | ||
this.ngAppRoot = value; | ||
if (this._content instanceof ProxyViewContainer) { | ||
const grid = new GridLayout(); | ||
grid.addChild(this._content); | ||
this.ngAppRoot = grid; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,55 @@ | ||
import { NgModuleBootstrap, NgModuleRef } from 'nger-core' | ||
import { NgModuleBootstrap, NgModuleRef, ApplicationRef, NgModuleMetadataKey, NgModuleClassAst } from 'nger-core' | ||
import { | ||
run as applicationRun | ||
run as applicationRun, | ||
on, | ||
launchEvent, | ||
LaunchEventData, | ||
exitEvent, | ||
ApplicationEventData, | ||
} from "tns-core-modules/application"; | ||
import { Injector } from 'nger-di' | ||
import { profile, uptime } from "tns-core-modules/profiling"; | ||
import { View } from "tns-core-modules/ui/core/view/view"; | ||
import { Injector, InjectionToken } from 'nger-di' | ||
import { AppHostView } from './app-host-view' | ||
import { setRootPage } from 'nger-platform-native' | ||
export const NATIVE_CONFIG = new InjectionToken(`NATIVE_CONFIG`) | ||
export class NgerPlatformIosBootstrap extends NgModuleBootstrap { | ||
injector: Injector; | ||
async run(ref: NgModuleRef<any>) { | ||
this.injector = ref.injector; | ||
on('launch', (args) => { | ||
console.log(`launch`) | ||
}) | ||
on('exitEvent', (args) => { | ||
console.log(`exitEvent`) | ||
}); | ||
const config = ref.injector.get(NATIVE_CONFIG) | ||
// ref.componentFactoryResolver.resolveComponentFactory() | ||
const ngModule = ref.context.getClass(NgModuleMetadataKey) as NgModuleClassAst; | ||
const bootstrap = ngModule.ast.metadataDef.bootstrap; | ||
const root = document.getElementById('app') as HTMLDivElement; | ||
const application = ref.injector.get(ApplicationRef) | ||
let rootContent: View; | ||
let tempAppHostView: AppHostView; | ||
tempAppHostView = new AppHostView(); | ||
setRootPage(<any>tempAppHostView); | ||
if (bootstrap) { | ||
bootstrap.map(boot => { | ||
const factory = ref.componentFactoryResolver.resolveComponentFactory(boot) | ||
const component = factory.create(ref.injector); | ||
}) | ||
} | ||
const launchCallback = profile( | ||
"nativescript-angular/platform-common.launchCallback", | ||
(args: LaunchEventData) => { | ||
console.log(`launchCallback`) | ||
}) | ||
const exitCallback = profile( | ||
"nativescript-angular/platform-common.exitCallback", (args: ApplicationEventData) => { | ||
console.log(`exitCallback`) | ||
}) | ||
on(launchEvent, launchCallback); | ||
on(exitEvent, exitCallback); | ||
applicationRun(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import { Cache } from 'nger-core' | ||
export class NgerSwapCache extends Cache { | ||
get<T>(key: string): Promise<T> { } | ||
put<T>(key: string, value: T): Promise<boolean> { } | ||
remove<T>(key: string): Promise<boolean> { } | ||
get<T>(key: string): Promise<T> { | ||
return new Promise(() => { }) | ||
} | ||
put<T>(key: string, value: T): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
remove<T>(key: string): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
clear(): void { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
export class NgerSwapLogger implements Logger { } | ||
import { Logger } from 'nger-core' | ||
export class NgerSwapLogger implements Logger { | ||
debug(...args: any[]) { } | ||
info(...args: any[]) { } | ||
warn(...args: any[]) { } | ||
error(...args: any[]) { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import { Cache } from 'nger-core' | ||
export class NgerTtCache extends Cache { | ||
get<T>(key: string): Promise<T> { } | ||
put<T>(key: string, value: T): Promise<boolean> { } | ||
remove<T>(key: string): Promise<boolean> { } | ||
async get<T>(key: string): Promise<T> { | ||
return new Promise(() => { }) | ||
} | ||
async put<T>(key: string, value: T): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
async remove<T>(key: string): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
clear(): void { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import { Cache } from 'nger-core' | ||
export class NgerWeappCache extends Cache { | ||
get<T>(key: string): Promise<T> { } | ||
put<T>(key: string, value: T): Promise<boolean> { } | ||
remove<T>(key: string): Promise<boolean> { } | ||
async get<T>(key: string): Promise<T> { | ||
return new Promise(() => { }) | ||
} | ||
async put<T>(key: string, value: T): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
async remove<T>(key: string): Promise<boolean> { | ||
return new Promise(() => { }) | ||
} | ||
clear(): void { } | ||
} |
Oops, something went wrong.