angular7

Angular 7:TypeError: Class constructor Observable cannot be invoked without 'new'

柔情痞子 提交于 2019-12-20 07:16:31
问题 this.db.object('/users/'+user.uid).update({ name:user.displayName,email:user.email }); } getting this error : core.js:9110 ERROR TypeError: Class constructor Observable cannot be invoked without 'new' at new FirebaseObjectObservable (firebase_object_observable.js:16) at FirebaseObjectFactory (firebase_object_factory.js:7) at AngularFireDatabase.push../node_modules/angularfire2/database/database.js.AngularFireDatabase.object (database.js:18) at UserService.save (user.service.ts:20) at

How to return object from service to component in angular

孤街浪徒 提交于 2019-12-20 06:39:53
问题 I want to access particular json in ngOninit. So i have id on click in edit button and with the help of that id i am getting complete object from database like form name , form json which etc. So from the service i want to return that json to ngOninit. Here is service. GetFormById (id: number) { return this.httpClient.get<FormTemplate[]>(this.API_URL + "GetFormTemplate/" + id).subscribe(data => { console.log(data); return data; }); } In console i am getting complete object from database which

Angular 7: How to re-write nested subscribtions?

会有一股神秘感。 提交于 2019-12-20 06:12:25
问题 I have a component that displays a filtered list of items. It is subscribed to two observables - the first one is for (filter) parameters that need to be passed into the second observable to get the filtered list of items. public filteredItems = []; this.myService.getFilterParams() .subscribe(params => { this.myService.getFilteredItems(params) .subscribe(items => { this.filteredItems = items}); }); I've read that chaining subscribtion is not the best practice (the code works fine otherwise),

Uncaught SyntaxError: Unexpected token export - popper.js error

旧时模样 提交于 2019-12-20 03:59:06
问题 Angular is giving the error: popper.js in bootstrap 4 gives SyntaxError Unexpected token export I'm getting this error from browser console. Even I changed the popper.min.js location reference but no use.. node_modules/popper.js/dist/umd/popper.min.js node_modules/popper.js/dist/ems/popper.min.js Angular.json "scripts": [ "node_modules/bootstrap/dist/js/bootstrap.min.js", "node_modules/jquery/dist/jquery.slim.min.js", "node_modules/popper.js/dist/popper.min.js" ] 回答1: Bootstrap.min.js is

TypeError: Object(…) is not a function for angular-material

夙愿已清 提交于 2019-12-20 02:42:11
问题 In angular 7, trying to use angular material mat-dialog-content. While importing in app.module.ts it gives the following error: TypeError: Object(...) is not a function like: Uncaught TypeError: Object(...) is not a function at platform.es5.js:102. package.json { "name": "image-cropp", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^7.2.15

TypeError: Object(…) is not a function for angular-material

南楼画角 提交于 2019-12-20 02:42:03
问题 In angular 7, trying to use angular material mat-dialog-content. While importing in app.module.ts it gives the following error: TypeError: Object(...) is not a function like: Uncaught TypeError: Object(...) is not a function at platform.es5.js:102. package.json { "name": "image-cropp", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^7.2.15

Custom Controls with Reactive Forms

跟風遠走 提交于 2019-12-18 09:53:33
问题 I am using Angular 7, Angular Material controls with Reactive Forms. I created custom text (matInput type="text"), number (matInput type="number"), select (matSelect) controls with Angular Material with mat-form-field Here is the stackblitz for my example. I am trying to attach the custom form controls to reactive form and trying to fire any validations on the form group automatically. I am using ControlValueAccessor to achieve this, however my Select is not being identified as form control

how to enable gzip compression in angular cli for production build

China☆狼群 提交于 2019-12-17 19:39:28
问题 I would want to compress the bundle files that are created when building the angular project. I use ng build --environment=${environment} to build the application currently and the version of "@angular/compiler-cli": "^4.0.0" do not generate the .gz files to the dist folder. What is the simplest way to generate .gz bundle files (preferable without touching webpack.config.js file)? PS: I knew the option for creating the .gz files was removed by the angular/cli team sometime back. But I need

Aframe angular 7 unable to load gltf model

白昼怎懂夜的黑 提交于 2019-12-16 18:06:10
问题 I am trying to display a gltf-model in Aframe using Angular 7. `<a-scene embedded="" cursor="rayOrigin: mouse"> <a-assets> <a-asset-item id="bedroom" src="../../assets/models/homedesign/scene.gltf"></a-asset-item> </a-assets> <a-entity id="camera" camera="" position="0 0 0" look-controls wasd-controls> </a-entity> <a-entity id="room" gltf-model="#bedroom" position="-14 -30 -125" rotation= "0 160 0" material-map="map: map"> </a-entity> </a-scene> ` But the model is not displayed and I see the

How to pass reactive form data between child to parent components with out using services

扶醉桌前 提交于 2019-12-14 03:45:51
问题 We would like to consume child reactive form data from parent when we click on parent button. Currently we are using viewchild for getting the child cpomponent reference. We are getting all static data but not the form filled data....................................................................................................... parent.component.ts @ViewChild(DetailsComponent) childrenComponent: childrenComponent; save(){ let model=this.childrenComponent.buildDetailsModel(); /*here api to