Angular 2 Release “Unexpected value 'ElementRef' imported by the module”Angular 2.0 Unexpected value '[object Object]' imported by the module 'AppModule'Angular2 RC5 error:zone.js: Unhandled Promise rejection: No provider for ElementRefunexpected directive value 'undefined' on the View of component AboutComponentAngular 2 RC5 update zone issueAngular 2 Component is not part of any NgModule“ng2-CKEditor” node module is not working with typescript[Angular2]SystemJS error when compiling ahead-of-time (no provider for NgZone)Cant assign data to ng2 piechart after receiving it in HTTP response“is not a function error” in angular 2Undefined import error Angular 2 with JsonpModuleprimeng p-menubar example not workingAngular 5 - ssr weird error
IList<T> implementation
What's the origin of the concept of alternate dimensions/realities?
Necessity of tenure for lifetime academic research
Do universities maintain secret textbooks?
Create a list of snaking numbers under 50,000
A vector is defined to have a magnitude and *a* direction, but the zero vector has no *single* direction. So, how is the zero vector a vector?
Which is the correct version of Mussorgsky's Pictures at an Exhibition?
Cheap oscilloscope showing 16 MHz square wave
What is the chance of getting a Red Cabbage in year 1?
Why do IR remotes influence AM radios?
Does the Freedom of Movement spell prevent petrification by the Flesh to Stone spell?
How can I improve my formal definitions?
apt-file regex: find multiple packages at once using or
Can two aircraft be allowed to stay on the same runway at the same time?
I failed to respond to a potential advisor
Coupling two 15 Amp circuit breaker for 20 Amp
New coworker has strange workplace requirements - how should I deal with them?
How did the Altair 8800 front panel load the program counter?
Understanding data transmission rates over copper wire
How to prevent graphics clipping through each other
Is "prohibition against," a double negative?
What caused the end of cybernetic implants?
What is this "opened" cube called?
How to load files as a quickfix window at start-up
Angular 2 Release “Unexpected value 'ElementRef' imported by the module”
Angular 2.0 Unexpected value '[object Object]' imported by the module 'AppModule'Angular2 RC5 error:zone.js: Unhandled Promise rejection: No provider for ElementRefunexpected directive value 'undefined' on the View of component AboutComponentAngular 2 RC5 update zone issueAngular 2 Component is not part of any NgModule“ng2-CKEditor” node module is not working with typescript[Angular2]SystemJS error when compiling ahead-of-time (no provider for NgZone)Cant assign data to ng2 piechart after receiving it in HTTP response“is not a function error” in angular 2Undefined import error Angular 2 with JsonpModuleprimeng p-menubar example not workingAngular 5 - ssr weird error
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I upgraded to the release of Angular 2 and I am trying to use ElementRef. At first, I got the error Angular2 RC5 error:zone.js: Unhandled Promise rejection: No provider for ElementRef as specified here: Angular2 RC5 error:zone.js: Unhandled Promise rejection: No provider for ElementRef so I changed my code to:
import NgModule, CUSTOM_ELEMENTS_SCHEMA, ElementRef from '@angular/core';
@NgModule(
declarations: [DashboardComponent, WidgetBankComponent, DataTableDirectives, OrderBy],
exports: [DashboardComponent, WidgetBankComponent],
imports: [BrowserModule, HttpModule, FormsModule, ChartsModule, ElementRef],
providers: [ChartService, GridService, WidgetsControlService, GridViewService, ApplicationSettingsService, DataService, ToolsService, LocalStorageService, RuntimeCompiler, COMPILER_PROVIDERS, NgGrid, NgGridItem],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
)
and now I am getting the error (SystemJS) Unexpected value 'ElementRef' imported by the module 'DashboardModule'
any ideas?
Thank you in advance!
EDIT
Did the suggested fix in the answer below and now have this error - here is the full error - is there a way to tell where i need to supply the provider from this error?
zone.js:355 Unhandled Promise rejection: No provider for ElementRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError _nativeError: Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.Base…, keys: Array[1], injectors: Array[1]_nativeError: Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.BaseError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1248:38)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1703:20)
at new NoProviderError (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1734:20)
at ReflectiveInjector_._throwOrNull (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3331:23)
at ReflectiveInjector_._getByKeyDefault (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3359:29)
at ReflectiveInjector_._getByKey (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3322:29)
at ReflectiveInjector_.get (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3131:25)
at NgModuleInjector.AppModuleInjector.createInternal (AppModule.ngfactory.js:310:75)
at NgModuleInjector.create (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:7192:80)constructResolvingMessage: (keys)injectors: Array[1]keys: Array[1]message: (...)name: (...)stack: (...)__proto__: AbstractProviderError Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.BaseError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1248:38)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1703:20)
at new NoProviderError (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1734:20)
at ReflectiveInjector_._throwOrNull (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3331:23)
at ReflectiveInjector_._getByKeyDefault (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3359:29)
at ReflectiveInjector_._getByKey (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3322:29)
at ReflectiveInjector_.get (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3131:25)
at NgModuleInjector.AppModuleInjector.createInternal (AppModule.ngfactory.js:310:75)
at NgModuleInjector.create (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:7192:80)consoleError @ zone.js:355_loop_1 @ zone.js:382drainMicroTaskQueue @ zone.js:386ZoneTask.invoke @ zone.js:308
zone.js:357 Error: Uncaught (in promise): Error: No provider for ElementRef!(…)consoleError @ zone.js:357_loop_1 @ zone.js:382drainMicroTaskQueue @ zone.js:386ZoneTask.invoke @ zone.js:308
javascript
add a comment |
I upgraded to the release of Angular 2 and I am trying to use ElementRef. At first, I got the error Angular2 RC5 error:zone.js: Unhandled Promise rejection: No provider for ElementRef as specified here: Angular2 RC5 error:zone.js: Unhandled Promise rejection: No provider for ElementRef so I changed my code to:
import NgModule, CUSTOM_ELEMENTS_SCHEMA, ElementRef from '@angular/core';
@NgModule(
declarations: [DashboardComponent, WidgetBankComponent, DataTableDirectives, OrderBy],
exports: [DashboardComponent, WidgetBankComponent],
imports: [BrowserModule, HttpModule, FormsModule, ChartsModule, ElementRef],
providers: [ChartService, GridService, WidgetsControlService, GridViewService, ApplicationSettingsService, DataService, ToolsService, LocalStorageService, RuntimeCompiler, COMPILER_PROVIDERS, NgGrid, NgGridItem],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
)
and now I am getting the error (SystemJS) Unexpected value 'ElementRef' imported by the module 'DashboardModule'
any ideas?
Thank you in advance!
EDIT
Did the suggested fix in the answer below and now have this error - here is the full error - is there a way to tell where i need to supply the provider from this error?
zone.js:355 Unhandled Promise rejection: No provider for ElementRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError _nativeError: Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.Base…, keys: Array[1], injectors: Array[1]_nativeError: Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.BaseError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1248:38)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1703:20)
at new NoProviderError (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1734:20)
at ReflectiveInjector_._throwOrNull (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3331:23)
at ReflectiveInjector_._getByKeyDefault (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3359:29)
at ReflectiveInjector_._getByKey (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3322:29)
at ReflectiveInjector_.get (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3131:25)
at NgModuleInjector.AppModuleInjector.createInternal (AppModule.ngfactory.js:310:75)
at NgModuleInjector.create (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:7192:80)constructResolvingMessage: (keys)injectors: Array[1]keys: Array[1]message: (...)name: (...)stack: (...)__proto__: AbstractProviderError Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.BaseError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1248:38)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1703:20)
at new NoProviderError (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1734:20)
at ReflectiveInjector_._throwOrNull (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3331:23)
at ReflectiveInjector_._getByKeyDefault (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3359:29)
at ReflectiveInjector_._getByKey (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3322:29)
at ReflectiveInjector_.get (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3131:25)
at NgModuleInjector.AppModuleInjector.createInternal (AppModule.ngfactory.js:310:75)
at NgModuleInjector.create (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:7192:80)consoleError @ zone.js:355_loop_1 @ zone.js:382drainMicroTaskQueue @ zone.js:386ZoneTask.invoke @ zone.js:308
zone.js:357 Error: Uncaught (in promise): Error: No provider for ElementRef!(…)consoleError @ zone.js:357_loop_1 @ zone.js:382drainMicroTaskQueue @ zone.js:386ZoneTask.invoke @ zone.js:308
javascript
which version of angular2 are you using?
– micronyks
Oct 1 '16 at 15:48
the final release
– blubberbo
Oct 1 '16 at 15:49
its strange! it should work. Which zone.js version are you using in final version?
– micronyks
Oct 1 '16 at 16:01
^0.6.25is my zone version. I am also using the ng2-charts and ng2-grid libraries, which I think might be calling ElementRef somewhere, so I was thinking I might be able to just include it everywhere
– blubberbo
Oct 1 '16 at 16:05
add a comment |
I upgraded to the release of Angular 2 and I am trying to use ElementRef. At first, I got the error Angular2 RC5 error:zone.js: Unhandled Promise rejection: No provider for ElementRef as specified here: Angular2 RC5 error:zone.js: Unhandled Promise rejection: No provider for ElementRef so I changed my code to:
import NgModule, CUSTOM_ELEMENTS_SCHEMA, ElementRef from '@angular/core';
@NgModule(
declarations: [DashboardComponent, WidgetBankComponent, DataTableDirectives, OrderBy],
exports: [DashboardComponent, WidgetBankComponent],
imports: [BrowserModule, HttpModule, FormsModule, ChartsModule, ElementRef],
providers: [ChartService, GridService, WidgetsControlService, GridViewService, ApplicationSettingsService, DataService, ToolsService, LocalStorageService, RuntimeCompiler, COMPILER_PROVIDERS, NgGrid, NgGridItem],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
)
and now I am getting the error (SystemJS) Unexpected value 'ElementRef' imported by the module 'DashboardModule'
any ideas?
Thank you in advance!
EDIT
Did the suggested fix in the answer below and now have this error - here is the full error - is there a way to tell where i need to supply the provider from this error?
zone.js:355 Unhandled Promise rejection: No provider for ElementRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError _nativeError: Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.Base…, keys: Array[1], injectors: Array[1]_nativeError: Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.BaseError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1248:38)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1703:20)
at new NoProviderError (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1734:20)
at ReflectiveInjector_._throwOrNull (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3331:23)
at ReflectiveInjector_._getByKeyDefault (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3359:29)
at ReflectiveInjector_._getByKey (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3322:29)
at ReflectiveInjector_.get (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3131:25)
at NgModuleInjector.AppModuleInjector.createInternal (AppModule.ngfactory.js:310:75)
at NgModuleInjector.create (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:7192:80)constructResolvingMessage: (keys)injectors: Array[1]keys: Array[1]message: (...)name: (...)stack: (...)__proto__: AbstractProviderError Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.BaseError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1248:38)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1703:20)
at new NoProviderError (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1734:20)
at ReflectiveInjector_._throwOrNull (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3331:23)
at ReflectiveInjector_._getByKeyDefault (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3359:29)
at ReflectiveInjector_._getByKey (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3322:29)
at ReflectiveInjector_.get (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3131:25)
at NgModuleInjector.AppModuleInjector.createInternal (AppModule.ngfactory.js:310:75)
at NgModuleInjector.create (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:7192:80)consoleError @ zone.js:355_loop_1 @ zone.js:382drainMicroTaskQueue @ zone.js:386ZoneTask.invoke @ zone.js:308
zone.js:357 Error: Uncaught (in promise): Error: No provider for ElementRef!(…)consoleError @ zone.js:357_loop_1 @ zone.js:382drainMicroTaskQueue @ zone.js:386ZoneTask.invoke @ zone.js:308
javascript
I upgraded to the release of Angular 2 and I am trying to use ElementRef. At first, I got the error Angular2 RC5 error:zone.js: Unhandled Promise rejection: No provider for ElementRef as specified here: Angular2 RC5 error:zone.js: Unhandled Promise rejection: No provider for ElementRef so I changed my code to:
import NgModule, CUSTOM_ELEMENTS_SCHEMA, ElementRef from '@angular/core';
@NgModule(
declarations: [DashboardComponent, WidgetBankComponent, DataTableDirectives, OrderBy],
exports: [DashboardComponent, WidgetBankComponent],
imports: [BrowserModule, HttpModule, FormsModule, ChartsModule, ElementRef],
providers: [ChartService, GridService, WidgetsControlService, GridViewService, ApplicationSettingsService, DataService, ToolsService, LocalStorageService, RuntimeCompiler, COMPILER_PROVIDERS, NgGrid, NgGridItem],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
)
and now I am getting the error (SystemJS) Unexpected value 'ElementRef' imported by the module 'DashboardModule'
any ideas?
Thank you in advance!
EDIT
Did the suggested fix in the answer below and now have this error - here is the full error - is there a way to tell where i need to supply the provider from this error?
zone.js:355 Unhandled Promise rejection: No provider for ElementRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError _nativeError: Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.Base…, keys: Array[1], injectors: Array[1]_nativeError: Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.BaseError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1248:38)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1703:20)
at new NoProviderError (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1734:20)
at ReflectiveInjector_._throwOrNull (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3331:23)
at ReflectiveInjector_._getByKeyDefault (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3359:29)
at ReflectiveInjector_._getByKey (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3322:29)
at ReflectiveInjector_.get (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3131:25)
at NgModuleInjector.AppModuleInjector.createInternal (AppModule.ngfactory.js:310:75)
at NgModuleInjector.create (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:7192:80)constructResolvingMessage: (keys)injectors: Array[1]keys: Array[1]message: (...)name: (...)stack: (...)__proto__: AbstractProviderError Error: No provider for ElementRef!
at NoProviderError.Error (native)
at NoProviderError.BaseError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1248:38)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1703:20)
at new NoProviderError (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:1734:20)
at ReflectiveInjector_._throwOrNull (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3331:23)
at ReflectiveInjector_._getByKeyDefault (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3359:29)
at ReflectiveInjector_._getByKey (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3322:29)
at ReflectiveInjector_.get (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:3131:25)
at NgModuleInjector.AppModuleInjector.createInternal (AppModule.ngfactory.js:310:75)
at NgModuleInjector.create (http://localhost:56159/node_modules/@angular/core//bundles/core.umd.js:7192:80)consoleError @ zone.js:355_loop_1 @ zone.js:382drainMicroTaskQueue @ zone.js:386ZoneTask.invoke @ zone.js:308
zone.js:357 Error: Uncaught (in promise): Error: No provider for ElementRef!(…)consoleError @ zone.js:357_loop_1 @ zone.js:382drainMicroTaskQueue @ zone.js:386ZoneTask.invoke @ zone.js:308
javascript
javascript
edited Mar 27 at 23:38
OneLunch Man
2,1019 silver badges22 bronze badges
2,1019 silver badges22 bronze badges
asked Oct 1 '16 at 15:19
blubberboblubberbo
1,3432 gold badges9 silver badges27 bronze badges
1,3432 gold badges9 silver badges27 bronze badges
which version of angular2 are you using?
– micronyks
Oct 1 '16 at 15:48
the final release
– blubberbo
Oct 1 '16 at 15:49
its strange! it should work. Which zone.js version are you using in final version?
– micronyks
Oct 1 '16 at 16:01
^0.6.25is my zone version. I am also using the ng2-charts and ng2-grid libraries, which I think might be calling ElementRef somewhere, so I was thinking I might be able to just include it everywhere
– blubberbo
Oct 1 '16 at 16:05
add a comment |
which version of angular2 are you using?
– micronyks
Oct 1 '16 at 15:48
the final release
– blubberbo
Oct 1 '16 at 15:49
its strange! it should work. Which zone.js version are you using in final version?
– micronyks
Oct 1 '16 at 16:01
^0.6.25is my zone version. I am also using the ng2-charts and ng2-grid libraries, which I think might be calling ElementRef somewhere, so I was thinking I might be able to just include it everywhere
– blubberbo
Oct 1 '16 at 16:05
which version of angular2 are you using?
– micronyks
Oct 1 '16 at 15:48
which version of angular2 are you using?
– micronyks
Oct 1 '16 at 15:48
the final release
– blubberbo
Oct 1 '16 at 15:49
the final release
– blubberbo
Oct 1 '16 at 15:49
its strange! it should work. Which zone.js version are you using in final version?
– micronyks
Oct 1 '16 at 16:01
its strange! it should work. Which zone.js version are you using in final version?
– micronyks
Oct 1 '16 at 16:01
^0.6.25 is my zone version. I am also using the ng2-charts and ng2-grid libraries, which I think might be calling ElementRef somewhere, so I was thinking I might be able to just include it everywhere– blubberbo
Oct 1 '16 at 16:05
^0.6.25 is my zone version. I am also using the ng2-charts and ng2-grid libraries, which I think might be calling ElementRef somewhere, so I was thinking I might be able to just include it everywhere– blubberbo
Oct 1 '16 at 16:05
add a comment |
2 Answers
2
active
oldest
votes
Try to remove ElementRef from imports array and paste it into array of providers:
import NgModule, CUSTOM_ELEMENTS_SCHEMA, ElementRef from '@angular/core';
@NgModule(
declarations: [DashboardComponent, WidgetBankComponent, DataTableDirectives, OrderBy],
exports: [DashboardComponent, WidgetBankComponent],
imports: [BrowserModule, HttpModule, FormsModule, ChartsModule],
providers: [ChartService, GridService, WidgetsControlService, GridViewService, ApplicationSettingsService, DataService, ToolsService, LocalStorageService, RuntimeCompiler, COMPILER_PROVIDERS, NgGrid, NgGridItem, ElementRef],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
)
that creates the same error as in the original posting :(
– blubberbo
Oct 2 '16 at 3:39
@blubberbo, you runtscfrom your root project folder?
– ktretyak
Oct 2 '16 at 3:43
That is correct
– blubberbo
Oct 2 '16 at 3:44
This worked for me.
– Josh1billion
Oct 13 '16 at 15:34
add a comment |
use it at individual component level where you need it.
import ElementRef from '@angular/core';
@Component(
....
)
export class DashboardComponent
constructor(private el:ElementRef)
then i getzone.js:355 Unhandled Promise rejection: No provider for ElementRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError... which leads me to believe i am referencing it somewhere, but i have no idea how to find out where. it might be a plugin i have, so i wanted to try and add it as a provider for all plugins
– blubberbo
Oct 1 '16 at 15:41
removeElementReffromimportsand do as I said.
– micronyks
Oct 1 '16 at 15:42
I removed it from the imports and i added it to the component like you said, and now i getno provider...
– blubberbo
Oct 1 '16 at 15:43
Then you have to show us more code.
– micronyks
Oct 1 '16 at 15:44
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39808264%2fangular-2-release-unexpected-value-elementref-imported-by-the-module%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try to remove ElementRef from imports array and paste it into array of providers:
import NgModule, CUSTOM_ELEMENTS_SCHEMA, ElementRef from '@angular/core';
@NgModule(
declarations: [DashboardComponent, WidgetBankComponent, DataTableDirectives, OrderBy],
exports: [DashboardComponent, WidgetBankComponent],
imports: [BrowserModule, HttpModule, FormsModule, ChartsModule],
providers: [ChartService, GridService, WidgetsControlService, GridViewService, ApplicationSettingsService, DataService, ToolsService, LocalStorageService, RuntimeCompiler, COMPILER_PROVIDERS, NgGrid, NgGridItem, ElementRef],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
)
that creates the same error as in the original posting :(
– blubberbo
Oct 2 '16 at 3:39
@blubberbo, you runtscfrom your root project folder?
– ktretyak
Oct 2 '16 at 3:43
That is correct
– blubberbo
Oct 2 '16 at 3:44
This worked for me.
– Josh1billion
Oct 13 '16 at 15:34
add a comment |
Try to remove ElementRef from imports array and paste it into array of providers:
import NgModule, CUSTOM_ELEMENTS_SCHEMA, ElementRef from '@angular/core';
@NgModule(
declarations: [DashboardComponent, WidgetBankComponent, DataTableDirectives, OrderBy],
exports: [DashboardComponent, WidgetBankComponent],
imports: [BrowserModule, HttpModule, FormsModule, ChartsModule],
providers: [ChartService, GridService, WidgetsControlService, GridViewService, ApplicationSettingsService, DataService, ToolsService, LocalStorageService, RuntimeCompiler, COMPILER_PROVIDERS, NgGrid, NgGridItem, ElementRef],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
)
that creates the same error as in the original posting :(
– blubberbo
Oct 2 '16 at 3:39
@blubberbo, you runtscfrom your root project folder?
– ktretyak
Oct 2 '16 at 3:43
That is correct
– blubberbo
Oct 2 '16 at 3:44
This worked for me.
– Josh1billion
Oct 13 '16 at 15:34
add a comment |
Try to remove ElementRef from imports array and paste it into array of providers:
import NgModule, CUSTOM_ELEMENTS_SCHEMA, ElementRef from '@angular/core';
@NgModule(
declarations: [DashboardComponent, WidgetBankComponent, DataTableDirectives, OrderBy],
exports: [DashboardComponent, WidgetBankComponent],
imports: [BrowserModule, HttpModule, FormsModule, ChartsModule],
providers: [ChartService, GridService, WidgetsControlService, GridViewService, ApplicationSettingsService, DataService, ToolsService, LocalStorageService, RuntimeCompiler, COMPILER_PROVIDERS, NgGrid, NgGridItem, ElementRef],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
)
Try to remove ElementRef from imports array and paste it into array of providers:
import NgModule, CUSTOM_ELEMENTS_SCHEMA, ElementRef from '@angular/core';
@NgModule(
declarations: [DashboardComponent, WidgetBankComponent, DataTableDirectives, OrderBy],
exports: [DashboardComponent, WidgetBankComponent],
imports: [BrowserModule, HttpModule, FormsModule, ChartsModule],
providers: [ChartService, GridService, WidgetsControlService, GridViewService, ApplicationSettingsService, DataService, ToolsService, LocalStorageService, RuntimeCompiler, COMPILER_PROVIDERS, NgGrid, NgGridItem, ElementRef],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
)
answered Oct 2 '16 at 2:56
ktretyakktretyak
5,0105 gold badges22 silver badges42 bronze badges
5,0105 gold badges22 silver badges42 bronze badges
that creates the same error as in the original posting :(
– blubberbo
Oct 2 '16 at 3:39
@blubberbo, you runtscfrom your root project folder?
– ktretyak
Oct 2 '16 at 3:43
That is correct
– blubberbo
Oct 2 '16 at 3:44
This worked for me.
– Josh1billion
Oct 13 '16 at 15:34
add a comment |
that creates the same error as in the original posting :(
– blubberbo
Oct 2 '16 at 3:39
@blubberbo, you runtscfrom your root project folder?
– ktretyak
Oct 2 '16 at 3:43
That is correct
– blubberbo
Oct 2 '16 at 3:44
This worked for me.
– Josh1billion
Oct 13 '16 at 15:34
that creates the same error as in the original posting :(
– blubberbo
Oct 2 '16 at 3:39
that creates the same error as in the original posting :(
– blubberbo
Oct 2 '16 at 3:39
@blubberbo, you run
tsc from your root project folder?– ktretyak
Oct 2 '16 at 3:43
@blubberbo, you run
tsc from your root project folder?– ktretyak
Oct 2 '16 at 3:43
That is correct
– blubberbo
Oct 2 '16 at 3:44
That is correct
– blubberbo
Oct 2 '16 at 3:44
This worked for me.
– Josh1billion
Oct 13 '16 at 15:34
This worked for me.
– Josh1billion
Oct 13 '16 at 15:34
add a comment |
use it at individual component level where you need it.
import ElementRef from '@angular/core';
@Component(
....
)
export class DashboardComponent
constructor(private el:ElementRef)
then i getzone.js:355 Unhandled Promise rejection: No provider for ElementRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError... which leads me to believe i am referencing it somewhere, but i have no idea how to find out where. it might be a plugin i have, so i wanted to try and add it as a provider for all plugins
– blubberbo
Oct 1 '16 at 15:41
removeElementReffromimportsand do as I said.
– micronyks
Oct 1 '16 at 15:42
I removed it from the imports and i added it to the component like you said, and now i getno provider...
– blubberbo
Oct 1 '16 at 15:43
Then you have to show us more code.
– micronyks
Oct 1 '16 at 15:44
add a comment |
use it at individual component level where you need it.
import ElementRef from '@angular/core';
@Component(
....
)
export class DashboardComponent
constructor(private el:ElementRef)
then i getzone.js:355 Unhandled Promise rejection: No provider for ElementRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError... which leads me to believe i am referencing it somewhere, but i have no idea how to find out where. it might be a plugin i have, so i wanted to try and add it as a provider for all plugins
– blubberbo
Oct 1 '16 at 15:41
removeElementReffromimportsand do as I said.
– micronyks
Oct 1 '16 at 15:42
I removed it from the imports and i added it to the component like you said, and now i getno provider...
– blubberbo
Oct 1 '16 at 15:43
Then you have to show us more code.
– micronyks
Oct 1 '16 at 15:44
add a comment |
use it at individual component level where you need it.
import ElementRef from '@angular/core';
@Component(
....
)
export class DashboardComponent
constructor(private el:ElementRef)
use it at individual component level where you need it.
import ElementRef from '@angular/core';
@Component(
....
)
export class DashboardComponent
constructor(private el:ElementRef)
answered Oct 1 '16 at 15:33
micronyksmicronyks
39.6k12 gold badges80 silver badges116 bronze badges
39.6k12 gold badges80 silver badges116 bronze badges
then i getzone.js:355 Unhandled Promise rejection: No provider for ElementRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError... which leads me to believe i am referencing it somewhere, but i have no idea how to find out where. it might be a plugin i have, so i wanted to try and add it as a provider for all plugins
– blubberbo
Oct 1 '16 at 15:41
removeElementReffromimportsand do as I said.
– micronyks
Oct 1 '16 at 15:42
I removed it from the imports and i added it to the component like you said, and now i getno provider...
– blubberbo
Oct 1 '16 at 15:43
Then you have to show us more code.
– micronyks
Oct 1 '16 at 15:44
add a comment |
then i getzone.js:355 Unhandled Promise rejection: No provider for ElementRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError... which leads me to believe i am referencing it somewhere, but i have no idea how to find out where. it might be a plugin i have, so i wanted to try and add it as a provider for all plugins
– blubberbo
Oct 1 '16 at 15:41
removeElementReffromimportsand do as I said.
– micronyks
Oct 1 '16 at 15:42
I removed it from the imports and i added it to the component like you said, and now i getno provider...
– blubberbo
Oct 1 '16 at 15:43
Then you have to show us more code.
– micronyks
Oct 1 '16 at 15:44
then i get
zone.js:355 Unhandled Promise rejection: No provider for ElementRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError... which leads me to believe i am referencing it somewhere, but i have no idea how to find out where. it might be a plugin i have, so i wanted to try and add it as a provider for all plugins– blubberbo
Oct 1 '16 at 15:41
then i get
zone.js:355 Unhandled Promise rejection: No provider for ElementRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError... which leads me to believe i am referencing it somewhere, but i have no idea how to find out where. it might be a plugin i have, so i wanted to try and add it as a provider for all plugins– blubberbo
Oct 1 '16 at 15:41
remove
ElementRef from imports and do as I said.– micronyks
Oct 1 '16 at 15:42
remove
ElementRef from imports and do as I said.– micronyks
Oct 1 '16 at 15:42
I removed it from the imports and i added it to the component like you said, and now i get
no provider...– blubberbo
Oct 1 '16 at 15:43
I removed it from the imports and i added it to the component like you said, and now i get
no provider...– blubberbo
Oct 1 '16 at 15:43
Then you have to show us more code.
– micronyks
Oct 1 '16 at 15:44
Then you have to show us more code.
– micronyks
Oct 1 '16 at 15:44
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39808264%2fangular-2-release-unexpected-value-elementref-imported-by-the-module%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
which version of angular2 are you using?
– micronyks
Oct 1 '16 at 15:48
the final release
– blubberbo
Oct 1 '16 at 15:49
its strange! it should work. Which zone.js version are you using in final version?
– micronyks
Oct 1 '16 at 16:01
^0.6.25is my zone version. I am also using the ng2-charts and ng2-grid libraries, which I think might be calling ElementRef somewhere, so I was thinking I might be able to just include it everywhere– blubberbo
Oct 1 '16 at 16:05