last day (14 days later) » 

1:26 AM
1
Q: Creating a angular2 service that displays a processing overlay

mwilsonI am trying to create a reusable component that serves as a processing overlay when making asynchronous calls across my site. I have a service in place but the OverlayComponent doesn't seem to get invoked when showOverlay is invoked: app.module.ts import { NgModule } from '@angular/core'; ...

 
What version of Angular2 are you using?
 
It should be what's currently released. Everything in my package.json is 2.1.1 ( i want to say beta 17)
 
TrackerComponent is importing with import { OverlayService } from '../../overlay.service.js'; try removing the ".js" extension
 
When I change that path, it results in the following:
public/app/ts/pages/Tracker/mysite.tracker.component.ts(10,3‌​2): error TS2307: Cannot find module './overlay.service'. [nodemon] failed to start process, possible issue with exec arguments events.js:165 throw err; ^
Error: Uncaught, unspecified "error" event. (2) at emit (events.js:163:17) at ChildProcess.<anonymous> (C:\Users\Marc\AppData\Roaming\npm\node_modules\nodemon\lib\‌​monitor\run.js:126‌​:1‌​1) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
I'm more than happy to push the working code to my public site or do a screen share you can see everything in it's entirety.
 
that would help, or alternatively you could put together a plunker
 
1:28 AM
I think it would be easier to do a screen share being that I have a gut feeling that it's the way my project is structured. There's not a whole lot in it but it'd take a very long time for me to learn how to mock it up in plunker. Do you have skype? We can do a screen share on there
I guess I can also put it into my github. I should mention I am using a full mean stack on this and there are mongodb connections though.
 
1:58 AM
One weird thing I'm noticing about that file path you mentioned for ../../overlay.service.js........web storm shows that the methods I'm calling are in use when I don't use the .js but if I add the .js, web storm says none of the methods are in use
 
I don't have the availability right now to do a screenshare, sorry
 
No worries. Thanks for your help
 
You should remove the .js extension, and double check the relative filepath to the overlay.service.ts/module though
I'm not sure what the compiler or bundler will do if it sees two different references in different files, one to the module, and the other to the .js file
maybe if you screenshotted the project folder structure, it could help
or alternatively, if you uploaded some of what you've got to github
 

last day (14 days later) »