zone

Access angular NgZone instance from window.object

自古美人都是妖i 提交于 2021-02-07 09:45:02
问题 Is it possible to access angular(2+) ZoneJS instance (NgZone) without injecting it inside constructor like this: ... const zone = window['<angular zonejs path in window object>'] ... For now when I developing my angular library I need to do this: class Test { constructor( zone: NgZone ) { initmyplugin(zone); } } But I don't wanna user to care about initialization of NgZone. 回答1: You can get hold of NgZone instance by using the following code: ng.probe(getAllAngularRootElements()[0]).injector

Access angular NgZone instance from window.object

荒凉一梦 提交于 2021-02-07 09:44:05
问题 Is it possible to access angular(2+) ZoneJS instance (NgZone) without injecting it inside constructor like this: ... const zone = window['<angular zonejs path in window object>'] ... For now when I developing my angular library I need to do this: class Test { constructor( zone: NgZone ) { initmyplugin(zone); } } But I don't wanna user to care about initialization of NgZone. 回答1: You can get hold of NgZone instance by using the following code: ng.probe(getAllAngularRootElements()[0]).injector

What does Angular Ivy specifically allow us to do in regards to manual change detection?

浪子不回头ぞ 提交于 2021-02-06 08:58:11
问题 This article mentions that Ivy opens a few possibilities for the future though. It should now be possible to run an application without zone.js, and to semi-manually handle change detection (a bit like you would with React). These APIs already exist but are experimental, not documented, and will probably change in the near future. I think it was already possible to run an application without zone.js prior to Ivy. Does Ivy allow to semi-manually handle change detection? Where are those

What does Angular Ivy specifically allow us to do in regards to manual change detection?

隐身守侯 提交于 2021-02-06 08:57:38
问题 This article mentions that Ivy opens a few possibilities for the future though. It should now be possible to run an application without zone.js, and to semi-manually handle change detection (a bit like you would with React). These APIs already exist but are experimental, not documented, and will probably change in the near future. I think it was already possible to run an application without zone.js prior to Ivy. Does Ivy allow to semi-manually handle change detection? Where are those

Unhandled Promise rejection: this._next is not a function : Zone in @angular/fire/messaging

a 夏天 提交于 2020-05-26 04:40:49
问题 When I am receiving firebase push notifications in the foreground, by using @angular/fire/messaging . The method is: this.angularFireMessaging.messages.subscribe( (payload) => { console.log("new message received. ", payload); this.currentMessage.next(payload); }) Let me share my complete code: PushNotificationsService Code I have written. My Angular-cli versions: Angular CLI: 8.1.3 Node: 12.4.0 OS: linux x64 Angular: 8.1.3 ... animations, cli, common, compiler, compiler-cli, core, forms ...

Unhandled Promise rejection: this._next is not a function : Zone in @angular/fire/messaging

守給你的承諾、 提交于 2020-05-26 04:39:17
问题 When I am receiving firebase push notifications in the foreground, by using @angular/fire/messaging . The method is: this.angularFireMessaging.messages.subscribe( (payload) => { console.log("new message received. ", payload); this.currentMessage.next(payload); }) Let me share my complete code: PushNotificationsService Code I have written. My Angular-cli versions: Angular CLI: 8.1.3 Node: 12.4.0 OS: linux x64 Angular: 8.1.3 ... animations, cli, common, compiler, compiler-cli, core, forms ...

How to change time zone settings using windows api

☆樱花仙子☆ 提交于 2020-02-02 08:34:28
问题 I need to change DST and time zone via API in my application. I modified & copied example of "SetTimeZoneInformation" usage by the end of the following link and have run it: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724944(v=vs.85).aspx I am assuming that my time settings should reflect on my time settings in tray or control panel. But nothing happens. Following thing also should be noticed. This code modifies "HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" key

How to change time zone settings using windows api

為{幸葍}努か 提交于 2020-02-02 08:32:27
问题 I need to change DST and time zone via API in my application. I modified & copied example of "SetTimeZoneInformation" usage by the end of the following link and have run it: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724944(v=vs.85).aspx I am assuming that my time settings should reflect on my time settings in tray or control panel. But nothing happens. Following thing also should be noticed. This code modifies "HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" key

Conflict between zone.js and Jasmine's clock

*爱你&永不变心* 提交于 2020-01-03 07:18:28
问题 I am working with a Jasmine testing suite that includes both "vanilla" Jasmine tests along with Jasmine tests for some Angular 2 components. Because of Angular 2's inclusion, zone.js gets loaded. This creates a conflict with Jasmine's clock. For example, the following test fails with the error, Error: Jasmine Clock was unable to install over custom global timer functions. Is the clock already installed? describe('an async test with zone.js present', function() { beforeEach(function() {

How to share common resources for all angular projects that run locally?

微笑、不失礼 提交于 2019-12-25 09:21:32
问题 I am attempting to set up a local environment to run multiple apps from one directory with common/shared resources. I have this directory structure (locally): |AngularApps |-App1 |-App2 |---app |---index.html |---tsconfig.json |---tslint.json |---typings.json |---systemjs.config.js |-node_modules |-package.json And then I use lite-server in root, hence I have modified the path in systemjs.config.js to: paths: { // paths serve as alias 'npm:': 'node_modules/' }, // map tells the System loader