angular5

Angular5: batch calls to get data for a filed in a json array

﹥>﹥吖頭↗ 提交于 2019-12-11 05:34:17
问题 I have an array with json data in the below format staff = [ { "id" : 1, "name" : "Robert" }, { "id" : 2, "name" : "Peter" } ] I am trying to get the designation of these people. There is an API which accepts group of ids. I am trying to get designations in batches of 30. i.e send first 30 objects and get their designations and go on.. I tried keeping a for loop and pass 30 objects but unsuccessful. Designation API gives data in the below format. [ { "staffId": "26", "designation": "PRA" }, {

Is there a way to send data from client to server in angular universal?

余生颓废 提交于 2019-12-11 05:28:44
问题 We are using angular 5.2.8 with nguniversal/express-engine 5.0.0-beta.6 and we are using external payment services. The payment system requires a form to be posted to their URL and has an input for callbackURL. The callback from that request sends us back a POST request with data. We need to post that data to our backend with user credentials. In angular we can't receive post requests. I have tried some options for the solution but none of them worked so far: Listening for posts in express

Can't show my array data in my page from database in angular 5?

眉间皱痕 提交于 2019-12-11 05:07:36
问题 I hope you're all fine, so I am having a little problem, I am getting data from firebase and I have an array containing an array and I want to show it in my view but I can't, I will write my code and explain what I want to achieve later. This is the data in my database : posts --- 1 --- puslisher -- "Erick" --- content : "Something is written here" --- comments --- 1 --- comment : "Yes" --- commentator : "Patrick" --- 2 --- comment : "I dont think so " --- commentator : "Sarah" --- 2 ---

Angular: two different modules or single module

ε祈祈猫儿з 提交于 2019-12-11 04:14:21
问题 I recently started working on Angular ( Angular5 ). My application has tabs named Home, School, Office and I have two types of users Admin and non-admin . As soon as the Office tab is clicked Admin page will be redirected to Admin page and non-admin user will be redirected to non-admin page. So, for this requirement do I need to make two different modules? OR shall I make a single module and redirect on the bases of user types? Please guide me with the project structure. 回答1: Yes, you need to

How to Change (Upgrade or Downgrade) Angular version?

梦想与她 提交于 2019-12-11 04:06:24
问题 I have recently installed Angular 6 and would like to go back to using Angular 5.2 How can I change my Angular version from whatever version I have to whichever one I choose? Answer: The version of angular used in a project is determined by the version of angular cli installed. any specific version of angular cli can be installed with the following command: npm install --global @angular/cli@x.x.x . example: npm install --global @angular/cli@1.6.6 even if you have another version of angular

How to refresh a page on Ionic 3 (Ionic, Angular 5)

旧时模样 提交于 2019-12-11 04:05:35
问题 I’m building a favorite list which I can erase list items within a page. It’s based on Ionic sqlite storage. I found Ionic page will keep removed ion list items until I re-enter the list page. So it needs refreshing a page upon removing an item from ionic storage. How can I refresh a particular page? window.location.refresh() seems to refresh the entire pages… this is not what I’m trying to do. I need to refresh a single page out of twenty pages on my app so navCtrl.setRoot() will not work

Angular error while building because external library - Unexpected value “BannerModule…”

空扰寡人 提交于 2019-12-11 03:23:40
问题 I created a library in order to share some components between two different projects, using ng-packagr module. The structure of the lib is In my library The src/package.json : { "name": "my-ng-library", "version": "0.0.0", "license": "MIT", "ngPackage": { "$schema": "./node_modules/ng-packagr/ng-package.schema.json", "lib": { "entryFile": "index.ts" }, "dest": "../dist" }, "private": false, "dependencies": {}, "peerDependencies": { "@angular/platform-browser": "^5.2.0", "@angular/platform

Angular 5: Dynamic Form Validation inside a table

十年热恋 提交于 2019-12-11 02:58:30
问题 I am trying to validate input fields inside a table using form group but unable to achieve the same. I am using *ngFor to iterate the data because I have to display that data in the first column of the table and other columns are just input text fields in which I have to add form validation. So I have added the index for the unique form control name for the field. HTML code <form [formGroup]="tableForm"> <table class="shop-table table-responsive" cellspacing="0"> <tbody> <tr class="cart_item"

Angular 5 get Material Select Value

核能气质少年 提交于 2019-12-11 02:57:14
问题 I'd like to get mat-option value from mat-select inside mat-form-field using form submit, how to return mat-option value? My HTML File : <form (submit)="updateProfileCompany($event)"> <mat-form-field> <mat-select name="company" placeholder="Select Your Company" #companyValue> <mat-option *ngFor="let company of companies" [value]="company.id"> {{company.perusahaan}} </mat-option> </mat-select> </mat-form-field> <div align="right"> <button mat-raised-button >Add Company</button> </div> </form>

How to exclude browser modules from being built in Angular 5 Universal app

雨燕双飞 提交于 2019-12-11 02:54:28
问题 I'm trying to create an Angular Universal app building a specific route at build time to inject an AppShell into Index.html page as a means to get meaningful content in front of the user as soon as possible (while Angular app is downloading). I am following the instructions found at Angular University and I have it working as instructed. However, as I systematically add my existing app's functionality into this test app, I'm running into 'Unexpected token import' error stemming from a 3rd