Newest 'angular2' Questions

Q&A for professional and enthusiast programmers

Child components needing data from their own API

I have a parent component (representing the current URL) and three child components. Each component needs to do an API request to get the data it needs. My initial solution was to subscribe in the ...

Unit testing Angular 2 JS code without using Karma

I am trying to execute the unit test cases from QuickStart Seed from Angular official site. I want to start using only Jasmine for unit testing so I have removed karma references from the project. ...

How to use DateRangePicker directive in Angular 2?

I want to use DateRangePicker in Angular 2 where a user can select the date range and on submit button it should be saved in any variable. I am using DateTimePickerDirective but unable to get ...

Angular2 springboot mysql

My question can be stupid still I want help, as I am totally new to Angular2 specially. I have hero-list.component.html file: <h1>Tour of Heroes ({{mode}})</h1> <h3>Heroes:</h3&...

Auth0 in Ionic2 running in Browser gives Uncaught can't find relay frame in callback

I am trying to get Auth0 working in Browser using ionic run browser I have followed the guides from Auth0. I am using auth0-7.6.1.min.js lock/10.10.2/lock.min.js versions. navigation to ...

Calling ngAfterContentInit in parent class - Angular 2

I think that ngAfterViewInit() should be called after a component's view, and its children's views, are created. I tested this, and found that children's ngAfterViewInit()s are called before the ...

Angular2 FormControl

I'm building a form using model-driven forms and building my form elements with formcontrol. I have a service where I put some functions and I send the formgroup to this function to access the ...

Ionic 2 call a function when exactly 10 digits inserted in textbox

I am new to ionic 2 / angular 2. I want to display a operators select box exactly when the user complete the 10 digit mobile number input. Till now i have created a function in ts showOperators() { ...

How to reference id when dynamically using createComponent

I have followed the tutorial over at https://angular.io/docs/ts/latest/cookbook/dynamic-component-loader.html#!#dynamic-loading and it´s working just fine. But now I need the host element to be in a *...

Check a radio button in an Angular unit test

I have a component in Angular with this HTML: <div class="row"> <label for="tipo" class="column">Tipo: </label> <div *ngFor="let tipo of tipos" class="column"> <...

Angular4 What definition of Iterable should I use

I have upgraded my app to the latest Angular 4 (beta-8) version. However I keep having the following error : @angular\core\src\change_detection\differs\iterable_differs.d.ts:14: TS2304 Cannot find ...

Angular 2 QueryList's find

I have a component with: @ViewChildren(MyDirective) factories: QueryList<MyDirective>; when I want to find an element in the QueryList it is working: ngAfterViewInit() { let field1 = this....

How to create a custom product tab in magento 2

How to create a custom product tab in magento 2 please answer in step wise with all code.

Testing ViewChild setter method in Angular2

I have a method that set onended event handler, when video element is initialize @ViewChild('mainVideo') set videoEventHandler(element: any) { if (element) { this.videoElement = element; ...

Issue showing show Div in <td> tag and span over full table space

I have a table in which last column has a clickable arrow. <table class="table table-hover table-striped"> <thead> <tr> <th>1</th> ...

Angular + Jasmine - Test whether an element is visible

I'm testing a web app made using Angular (2+), I'm using Jasmine + Karma as testing environment. I've searched a lot but I'm not able to test whether an element is visible or not, I thought I'd find a ...

Supplied parameters do not match any signature of call target. with new Observable

I am developing an Angular2 app which shows log messages from a NodeJS server. I transport these messages over SocketIO, which I then dump into an Observable. let logObservable = new Observable(...

should i use angular-cli for projects

This question might already be asked but i am not able to find a good answer to this. i am new to angular 2 and i saw there is great "angular-cli" project which offer many features out of the box ...

Error: (SystemJS) XHR error (404 Not Found) loading ng2-appinsights

I am trying to implement the application insights in my angular 2 application using ng2-appinsights. For that I followed the below link https://www.npmjs.com/package/ng2-appinsights This is the code ...

Error: Unexpected value 'Http' imported by the module 'AppModule' at SyntaxError.ZoneAwareError

I've checked my code several times and tried finding similar problems on the web and stackoverflow, but I'm out of ideas by now, I simply can't see my mistake. Do you have any recommendations as to ...

Angular2 editable table updates neighbouring cell

I'm having a strange behaviour with an editable table. After adding a row to the table, I'm changing the value in the first column of the new row. The updated value is not only shown in the first ...

Make API Request at a given time to update current radio show Angular2 RxJS

I'm working on a schedule for a community radio station and wondered how I might go about updating the current show playing. I've got as far as polling the server once a minute (not sure this is the ...

runOutsideAngular with drag an drop, service and component

I am trying to properly implement NgZone runOutsideAngular with drag and drop. In my architecture, users can drag an element in a list and drop it at some other position. While dragging, I am showing ...

Routes under Routes -angular 2

i have a dashboard component with a sub component called SMS. Now, the SMS component also has it routing list. How can i route under the sms navigation bar under the dashboard component. Below is the ...

Code-coverage with Karma and Jasmine

I'm writing tests with Jasmine and can see results with Karma (npm test) in console. I would like to configure code-coverage with carma-coverage and see results. My karma.config.js When I start ...

Change max width on a tab

I try to use this plugin on my project. I want to have multiple tabs and possibily to scroll on my tabs menu. The plugin : https://market.ionic.io/plugins/ionic-2-scrollable-tabs I can scroll on ...

Kendo UI Angular Scrollview - HTML

When binding data in the <kendo-scrollview></kendo-scrollview>, is it possible to bind html to display a different page according to the data it has? E.g. Hello sir. instead of it ...

Chrome extension and angular2 prepare for production

I have a simple chrome extension with popup and when you click on browser action the popup shows up and loads angular2 application. Angular2 applicaiton is simple: main.ts import { ...

angular 2 console error Can't bind to 'ngIf' since it isn't a known property of 'span'

Please don't mark this "duplicate of...". I've read the other SO posts that describe this error. I have tried those solutions. If you look at my code below you will see I do have the BrowserModule ...

Lazy loaded module not working in prod mode when using mgechev angular2-seed

I'm building an app that need to have lazy loaded module. Everything is working fine on dev mode. When I try to prepare prod dist I have problems with lazy loaded module. Deployment to prod: I'm ...

Angular 2 using RxJS - take(1) vs first()

I found few implementation of Auth Guards that uses take(1). On my project, I used first() to satisfy my needs. Does it work the same way? Or one of them might have advantages or so. import 'rxjs/add/...

How to add contacts in ionic 2?

I am trying to save the contact number in mobile phone. http://tphangout.com/ionic-2-making-use-of-the-contacts-plugin/ I am trying to save my contact number in mobile phone but i am getting an ...

How to implement material lite steppers in Angular2

UPDATE: basically no material styles are being applied. I tried with toggle and slider but it doesn't work. I have an angular2 project created with CLI and I am using material lite for styling. What ...

Pattern to enable customization through DI

I'm looking at the implementation of in-memory-web-api and there is the following code: @Injectable() export class InMemoryBackendService { protected config: InMemoryBackendConfigArgs = new ...

angular 2 - ngFor subnavbar menu doesn't work with css

.sub-navbar { background-color: #002b31; height:57px; font-size: 13px; margin-top: 175px; } this is my css file , and this is my html file <div class="container-fluid"> <...

angular2: inject generic service?

What's the recommended approach for injecting a generic service into a component? For instance, suppose you've got this: export class Service<T>{ ... } Now, lets suppose we've also got a class ...

Angular CLI, localhost:3000 not working-“Connection Refused” (Angular 2)

I am trying to run my current Angular 2 project using ng serve but the browser shows the error "Connection Refused", I have tried other ports too and the problem still exists.@angular/cli cmd image ...

Vis js library 3d chart :: Pinch to zoom issue in touch devices

I have used Vis js Library 3D chart to show the data using 3 axes i.e x,y and z. It is working fine and the graph is also displayed perfectly and also the rotating and zoom is also working fine on the ...

Installing WIJMO for angular2 using NPM

I am not able to install WIJMO responsive package to my angular2 project using NPM. I would like to know if there is any better way for doing this using a web-package. Thanks in advance!! Best, ...

How to use /dist folder files created by angular-cli ng build command to create an app that can be run by itself?

In order to see the ng build result, I need to run ng serve, but how that helps me to create an angular2 project that I can run in any web hosting? my web hosting don't know angular2 or ng serve ...

Virtual scroll for angular 2

Hi there! I am in need to create a table with so many records using angular js 2. For that, I'm trying virtual scroll. Still, I can't find any documentation or samples in a working condition Please ...

Angular 2 autosuggest with editable div and RxJS

I have a simple editable div : <div #editable editable=true (keypress)='seach(editable.innerText)'></div> In my component class i have the search method : .... .... search(event: any) ...

Angular 2 css modules

I tried use @Component({ selector: 'about', template: './about.hmtl', styles: ['.block {background-color: red} ...'] // <-- This will generate css modules }) This works fine, angular ...

How to connect angular 2 application with spring-oauth2 server?

I have an oauth-server secured with 'spring-cloud-oauth2' and 'spring-cloud-security' and the application is a spring-boot application. I am trying to get access_token from an angular 2 app, i.e. I ...

Type 'Type' is not generic

I am trying to introduce pagination to my app but getting the error. I am following ng2-bootstrap this is how I declared fields in my component: public bigTotalItems: number = IEmployee.length; ...

Angular 2 combining of multiple (similar) observables

I've found many examples detailing how multiple observable calls can be combined into a single Observable call, but from what I have found, these calls always assume at least one of the following: 1: ...

Angular 2 defining base url

On my server I can´t put the Angular 2 files into the root folder. So my path is /another-folder. I put that into my index.html like this: <base href="/another-folder"> When I open up the URL ...

User control inside ag-grid cell

Ho do I put a user control inside an ag-grid cell editor? Column Definition : { headerName: 'Product', field: 'product', width: 140, editable: true, ...

Render Pi-Chart multiple times?

I am creating an Angular project and want to implement pi-charts. I have searched a lot but didn't found anything helpful for me. I have implemented this charts from angular2-google-chart. In my HTML ...

With the angular CLI update (ng eject), how can I configure SCSS source maps?

The new angular CLI allow to override webpack configurations. But I`m no figuring out how to configure SCSS Source maps.
Translating... 0%