Questions tagged [angular6]

2

votes
4

answer
29

Views

Angular 6 custom validation return type

I have this code in my project for custom validation but I am unable to understand what does : (group: FormGroup) => ValidationResult mean here? I understand : (group: FormGroup) means return type but then what does => ValidationResult mean here? static comparePasswords(passwordKey: string, confirmP...
Mrug
1

votes
1

answer
9

Views

How can i divide the tooptip large data in different columns 10 per column

chart = c3.generate({ bindto: '#yearly', data: { x: 'x', columns: [ [x,1,2,.....,100], [data1,10,20.....,30], [data2,15,16,......,90], . . . [data50,20,30,......,80] ] } }); In my tooptip 1 to 50 row are show but i want to divivde them in colomns with 10 rows like- data1 - 10 | data 11 - 10 ....
Nandini
1

votes
0

answer
183

Views

I want filter to JSON data using Angular 5 services, but filtering should be done on server level (Live Search)

I know there's a concept of pipes, but for pipes to work it should have all the data. I am using Angular Services import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Patient } from '../shared/patient'; import { Observable } from 'rxjs/Observable';...
Prasang
1

votes
3

answer
675

Views

Compile error after update Angular and RxJS 5 to 6

I'm having an issue after updating libraries to new Angular 6 and RxJS 6. I have RouteService class which is working as service. It uses HttpClient to get data from remote API. After update I'm getting some weird error when I try to compile project. Here's my service class: import {Injectable} from...
user3626048
1

votes
1

answer
568

Views

Migrating from Angular 5 to Angular 6 i got these error TypeError: You provided an invalid object where a stream was expected

These code was workig ok in Angular 5 but when migrating to Angular 6 I got the error message: ERROR Error: Uncaught (in promise): TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable. TypeError: You provided an invalid obj...
1

votes
2

answer
840

Views

Angular6 rxjs 6 update

Hi I appreciate these are a pain. After updating Angular to version 6 and rxjs to version 6 we are getting a lot of browser errors that the system is unable to instantiate a number of packages. We use a combination of node_modules and systemjs.config.server.js without trying to start an argument o...
Lewis
1

votes
0

answer
1.1k

Views

angular 6 router navigation not working

I have migrated my angular application from angular 5 to 6, when I am calling router navigation, this.router.navigate(['doctor-log-in']).then(function (res) { console.log(res); }, function (err) { console.log('in errrrr'); console.log(err); }); it's giving Below Error main.9819f0c7d0ec0efd5341.js...
1

votes
1

answer
210

Views

Angular 6 router navigation giving error Cannot read property 'OVERWRITE'

I have migrated my angular application from Angular 5 to 6, when I am calling router navigation, this.router.navigate(['doctor-log-in']).then(function (res) { console.log(res); }, function (err) { console.log('in errrrr'); console.log(err); }); it's giving below error main.9819f0c7d0ec0efd5341.js:1...
1

votes
1

answer
239

Views

Updating the Angular app from version 4.x.x to 6.0

I have a very big project with a lot of components. Actually it is an open source project to which I am contributing.It was built on Angular 4. Currently it is running on Angular 4. I am trying to update it by following this site https://update.angular.io/ and manually searching for use of each depe...
bro33
1

votes
0

answer
110

Views

Components containing public dialog: MatDialog, in constructor fails to load

After upgrading from Angular 5.2 to 6 The app fails to load components components containing public dialog: MatDialog in the constructor. building/serving using --prod flag. (Works fine using ng serve and ng build.) Console error when using --aot: Error: Uncaught (in promise): TypeError: factory is...
Kake
1

votes
2

answer
630

Views

Cannot read property '1' of null - Angular 6 Update

I keep getting this error when trying to upgrade by Angular 5 project to Angular 6 when running ng update @angular/cli: Error: Cannot read property '1' of null Cannot read property '1' of null I'm following the update guide exactly, but not sure why this is happening. Has anyone come across this?
1

votes
3

answer
393

Views

http-server -p 8080 does not serve my angular application. Whereas ng serve does

This is what I see when I open my localhost I want to make a PWA with Angular so I followed the instructions on the angular.io website to the smallest detail yet it doesn't open the usual 'Welcome to your app' page. What might be the problem? I am have the following installed: Angular CLI: 6.0.1 No...
Captain A
1

votes
0

answer
426

Views

Issue with loading third party library in Angular 6

Issue with loading third party library which is dependence on another third party library. In my case, i'm using bootstrap(v3.3.7) which is required JQuery. I included these libraries as per angular suggested way and successfully compile the application, if run it in browser i got a console error. V...
santhosh k
1

votes
1

answer
60

Views

Cannot import MaterialTimeControlModule after installation

I am trying to install https://github.com/SteveDunlap13/MaterialTimeControl under Angular 6. The installation succeeds without errors but I still cannot import the MaterialTimeControlModule. All I can see is in my node_modules/ this is the only directory which is not marked as 'orange' so I guess th...
displayname
1

votes
0

answer
756

Views

Angular 6 - httpClient Error message not from response error data

I am using Angular 6 httpClient and I am having issues with the error responses. Here is the code: postIt() { return this.http.post(URL, { ...httpOptions, responseType: 'text', observe: 'response' }).subscribe( result => { console.log(result); }, error => { console.log('There was an error: ', error)...
Paul B
1

votes
0

answer
28

Views

Pass element refrence to self from DOM back to view model

Known feature: this passes the div back to the VM for manipulation, etc. What I'm looking for is short hand to pass an element to a method without declaring a template variable. It could look like this: This would be helpful in cases where creating elements in an ngFor stops you from giving every el...
Scott Clark
1

votes
0

answer
325

Views

Ionic 3 keyboard plugin not working

I have a chat app which shows the user the keyboard when they tap the input. Using Ionic's documentation I have added the onKeyboardShow() observer to my ts file. However it will not fire, no matter where i place it. The keyboard can be shown and hid over and over and nothing is ever fired. import {...
user3024827
1

votes
0

answer
322

Views

How to add Input Field Inside Data table

I'm using the following method to show multiple mat-cell using *ngFor: columns = [ { columnDef: 'qty', header: 'Qty', cell: (row: SaleItem) => `${row.quantity}` }, { columnDef: 'discount', header: 'Discount', cell: (row: SaleItem) => `${row.discount}` } ]; salesItemsDisplayedColumns = this.columns.m...
androniennn
1

votes
2

answer
170

Views

Angular 6 code conversion with backend reading

I have been trying to convert these method to the latest Angular 6 version of this code. My back-end sends a JSON file to the Angular application this method takes this JSON file and makes it so I can read it for my HTML. But sadly I do not understand how to refactor this code to Angular 6 since you...
Unknown Angel
1

votes
0

answer
299

Views

TreeShakeable Providers in Angular 6 and Injector

Angular 6 has introduced tree shakeable providers with the @Inject({provideIn:'...'} syntax. In order to take advantage of the tree shaking aspect, does it make a difference whether I inject the service directly via the constructor or via an Injector? Example: Sevice: @Inject({provideIn:'...'} cla...
Carsten
1

votes
0

answer
109

Views

How to import an application service into a library

I have enter the code on these file. src/assets/icons/svg/noun/a.sv src/assets/icons/svg/svgs.ts In app directory I have the following service that attempts to access svgs.ts. import { Injectable } from '@angular/core'; import { svgs } from '../assets/icons/svg/svgs' @Injectable({ providedIn: 'root'...
1

votes
1

answer
663

Views

Angular: How to show a Toast when resolve() results in an error

I am trying to fetch data by means of resolve, before I navigate users to the other page. I am able to do this successfully when the resolve is successful. What I am trying to do is, when the resolve fails, for whatever reason, show a Toast message (custom component that I made) to the user with a c...
Devner
1

votes
1

answer
778

Views

Jquery not defined in angular 6 after upgrade

I recently upgraded my application from Angular-5 to Angular-6 and Jquery suddenly stopped working. It was working fine in Angular 5 but no longer working in Angular 6. The error states: $(...).DataTable is not a function
mass
1

votes
1

answer
204

Views

Running an Angular6 project on VS2017

I have created an angular 6 project by first creating a 'Console Node js App', and then importing the result of a 'ng create ...'. The project builds fine, but i can't figure out how to run it, that is, how to run the command 'ng serve' from a Ctrl-F5 on VS2017. Is that possible? Can I run a bat/ex...
WoF_Angel
1

votes
1

answer
133

Views

MathJax showing normal text in different components of Angular 6

I am trying to use MathJax in my Angular application. I have got it working in the App Component, however whenever I move the exact code to any other component, it just shows the actual text, not the computed MathJax. This is the code I used: \(\sqrt b\) I think it might be to do with the *ngIf on...
G. Ross
1

votes
1

answer
282

Views

Angular CLI 6: How to consume a library sub-project in the main application?

I've got an Angular 6 project that's made of up a main application, and a separate sub-project that is a library. I'm trying to consume this library from the main application, and I can't seem to get it working. In the tsconfig.json, I have the following paths configuration: 'paths': { '@my-company/...
Joe Attardi
1

votes
1

answer
478

Views

Angular 6: Strange "Property xxx is protected and only accessible within class and its subclasses

I have a library project that I'm migrating to Angular 6 and Angular CLI 6. There's an abstract class called NativeFormElementChild that has some private properties: _id, _required, _ariaDescribedBy, and _ariaRequired. Then I have a directive, InputDirective, that's applied to a as an attribute (a...
Joe Attardi
1

votes
1

answer
1.5k

Views

angular material pagination not working with expandable row

I'm trying to use angular material table with expandable rows with paginator, the problem is, with the custom connect MatTableDataSource used for the expandable row the pagination stops working, I didn't find the answers anywhere to the problem. So, the test table data is given by this stub service:...
BigFilhao
1

votes
0

answer
234

Views

Close Angular Material Stepper

This may be a very simple question. How do you close the Angular Material Stepper? I want to close the box via a mat-button, but i did not see it in the documentation. Maybe i am blind. https://material.angular.io/components/stepper/overview#completed-step
1

votes
0

answer
572

Views

angular 6 (Versions of @angular/compiler-cli and typescript could not be determined)

can't start new project. $ ng serve --open Versions of @angular/compiler-cli and typescript could not be determined. The most common reason for this is a broken npm install. Please make sure your package.json contains both @angular/compiler-cli and typescript in devDependencies, then delete node_mod...
aaaaaaaaax10
1

votes
1

answer
249

Views

unable to create a progress bar to during page loading

Inspired from the SO answer - Show loading screen when navigating between routes in Angular 2, I want to show a progress bar before the main page of my Angular application uploads. But it isn't working. I have created a progress component with selector app-progress-bar'. Its HTML is progress.compone...
Manu Chadha
1

votes
0

answer
300

Views

Angular6 ViewChildren host not changed when data binded updated

I just noticed that ViewChildren hosts are not updated automatically. Code like below: In template: @ViewChildren(DemoDirective) compHosts: DemoDirective[]; now if I change componentNames variable in the component, I found that compHosts are not changed still same quantity as of initialized. I think...
user3006967
1

votes
0

answer
216

Views

Injected service not working

I am trying to test an Angular 6 component with a mocked service. My intention with the code below is to have nested describe statements to allow different versions of a mocked service to return different results The real service does some HTTP calls, whereas my mock returns an Observable with the d...
SimonMorris
1

votes
2

answer
630

Views

Angular 6 library: ng build library in CI pipeline to create lib release

I'm trying to build an Angular 6 library for CI integration without integrate it into an Angular App. (for numerous reasons) What i have done so far is: create a package.json in order to install all the lib's dependencies create an angular.json like regular angular6 app refering to ci files (see bel...
sebastian
1

votes
0

answer
237

Views

setting up angular 6 base_url not pointing to root in NodeJS server

I need to set up my angular 6 project NOT pointing to root, but to /v3/, this is what I did, 1. change base href in index.html to '/v3' 2. start app using ng serve --base-href /v3/ Now it worked fine for dev server at http://localhost:4200/v3/ But now I need to config my nodeJS server to serve this...
user3006967
1

votes
0

answer
88

Views

How to return value with callback function and regular func

I want to get object companies from localStorage if exist and return it and go to server and update companies in localStorage if localStorageCompanies is empty i need to subscribe the one who called the function to get the result from the server, hot i do it? and how i exeute this code: localStora...
david
1

votes
1

answer
311

Views

Angular 6 svg add class to path on click

I am trying to add class into my svg map inside angular onclick event: I have a working code it works inside ngOnInit() but when I add same code inside a click event function it is not working: My ngOnInit code is: ngOnInit() { let a = document.getElementById('biharsvg') as HTMLObjectElement;; a.a...
1

votes
2

answer
303

Views

Angular v6 Elements @Input() For Initial Binding Not Working

I have created a custom element and placed on a page like this: In the component definition, I have this: @Input() value: number = 50; At run-time, the value is always 50. I expect it to be 100. If I remove the default, value is undefined. What am I missing? Thanks!!
Bill Cunnien
1

votes
0

answer
746

Views

angular material bottom sheet do not bind data to content inside at seconds click?

here is my server to test http://badpaybad.info/home-cook/ In localhost everything ok. In my server to test I got problem: 1st click bottomsheet render oki. 2nd click bottomsheet do not bind data, API returned data oki. chrome no error logs. here is code in ts file product = new ProductDetailHomeP...
1

votes
0

answer
401

Views

Angular 6, Firebase Storage web Image gallery

I've got a problem with downloading URL during uploading an image file. I want to use this url to show this images from Firebase storage. Uplad is working, because i can see this photos on my storage on firebase, but i can't download it and show in my web Here's a upload.service.ts import { Injectab...
Kucha

View additional questions