Skip to content

Commit

Permalink
fix(livesync): attach __onLiveSyncCore to global object (#4215)
Browse files Browse the repository at this point in the history
That method needs to be exposed because it's used in NativeScript Angular (https://github.com/NativeScript/nativescript-angular/blob/master/nativescript-angular/platform-common.ts#L91).
  • Loading branch information
sis0k0 committed May 18, 2017
1 parent a96a957 commit 90a0da2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tns-core-modules/ui/frame/frame-common.ts
Expand Up @@ -24,7 +24,7 @@ function onLivesync(args: EventData): void {
}

try {
reloadPage();
g.__onLiveSyncCore();
} catch (ex) {
// Show the error as modal page, save reference to the page in global context.
g.errorPage = parse(`<Page><ScrollView><Label text="${ex}" textWrap="true" style="color: red;" /></ScrollView></Page>`);
Expand Down Expand Up @@ -74,6 +74,9 @@ export function reloadPage(): void {
}
}

// attach on global, so it can be overwritten in NativeScript Angular
(<any>global).__onLiveSyncCore = reloadPage;

export function resolvePageFromEntry(entry: NavigationEntry): Page {
let page: Page;

Expand Down

0 comments on commit 90a0da2

Please sign in to comment.