Skip to content

Commit

Permalink
feat(angular): adds DomController
Browse files Browse the repository at this point in the history
fix #14286
  • Loading branch information
manucorporat committed Apr 11, 2018
1 parent 12a27bc commit 6a31f39
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions angular/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const PROVIDERS = [
p.NavController,
p.Platform,
p.Events,
p.DomController
];

@NgModule({
Expand Down
20 changes: 20 additions & 0 deletions angular/src/providers/dom-controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Injectable } from '@angular/core';

@Injectable()
export class DomController {

read(cb: RafCallback) {
getQueue().read(cb);
}

write(cb: RafCallback) {
getQueue().write(cb);
}
}

function getQueue() {
const ionic = (window as any).Ionic;
return ionic.queue;

This comment has been minimized.

Copy link
@dylanvdmerwe

dylanvdmerwe Apr 12, 2018

Contributor

Is this always guaranteed to return a value and not be null?

}

export type RafCallback = { (timeStamp?: number): void };
1 change: 1 addition & 0 deletions angular/src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export { Platform } from './platform';
export { PopoverController } from './popover-controller';
export { ToastController } from './toast-controller';
export { NavController } from './nav-controller';
export { DomController } from './dom-controller';

0 comments on commit 6a31f39

Please sign in to comment.