I have service which returns an observable which does an http request to my server and gets the data. I want to use this data but I always end up getting undefined. What's the problem?  Service:  @Injectable() export class EventService {    con...
Is there a way to pass arguments rendered on the backend to angular2 bootstrap method? I want to set http header for all requests using BaseRequestOptions with value provided from the backend. My main.ts file looks like this:  import { bootstrap }...
I know how to inject a service into a component (via @Component), but how can I use DI to pass around services outside of components?  In other words, I don't want to do this:  export class MyFirstSvc {  }  export class MySecondSvc {     constr...
I have this module which componentize the external library together with additional logic without adding the <script> tag directly into the index.html:  import 'http://external.com/path/file.js' //import '../js/file.js'  @Comp...
What is wrong with my Angular code? I am getting:  Cannot read property 'remove' of undefined at BrowserDomAdapter.removeClass ...   HTML  <ol class="breadcrumb">     <li *ngClass="{active: step==='step1'}"...
I am having a hard time trying to get the lodash modules imported. I've setup my project using npm+gulp, and keep hitting the same wall. I've tried the regular lodash, but also lodash-es.  The lodash npm package: (has an index.js file in th...
In AngularJS I can debounce a model by using ng-model options.  ng-model-options="{ debounce: 1000 }"   How can I debounce a model in Angular? I tried to search for debounce in the docs but I couldn't find anything.  https://angular.io/...
I am trying to a simple application. I have an Express backend which, returns a JSON string when visited at localhost:4201/ticker. When I run the server and, make a request to this link from my Angular Service over http, I get the following error:...
This is What I Want To Do.  @Component({    selector: "data",    template: "<h1>{{ getData() }}</h1>" })  export class DataComponent{     this.http.get(path).subscribe({        res => return res;     }) }   If getData...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.