angular8

How to save statement input Angular?

爷,独闯天下 提交于 2019-12-05 10:40:21
问题 <tr *ngFor="let item of items"> <td>{{ item.id }}</td> <td>{{ item.name }}</td> <td>{{ item.score }}</td> <td><input size="7" /></td> </tr> Where items in array of objects that is received from server each 5 seconds. Problem is if fill inputs <input size="7" /> it will be replaced after next rendering. How to save the statement of these inputs? 回答1: Angular will recreate DOM elements when items in a collection are changed and rendered via *ngFor . By default, Angular will track how items are

error TS2554: Expected 2 arguments, but got 1 with @ViewChild

青春壹個敷衍的年華 提交于 2019-12-05 08:46:19
问题 I was using ViewChild as follows: @ViewChild("InternalMedia") localStream; @ViewChild("emoji") mEmoji; Which was working fine till angular-7.x as soon as I upgraded it to angular-8.x it started giving following error .../call_emoji/component.ts(41,4): error TS2554: Expected 2 arguments, but got 1. I checked https://angular.io/api/core/ViewChild and when I change it to @ViewChild("InternalMedia",{static:false}) remoteStream; It works. I'm not getting what static does and what should be it's

ng serve is not working after Angular 8 update

倖福魔咒の 提交于 2019-12-03 15:28:07
问题 Error Could not find the implementation for builder @angular-devkit/build-angular:dev-server ng serve Could not find the implementation for builder @angular-devkit/build-angular:dev-server Error: Could not find the implementation for builder @angular-devkit/build-angular:dev-server at WorkspaceNodeModulesArchitectHost.resolveBuilder (D:\angular-tour-of-heroes\node_modules\@angular\cli\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js:49:19) at ServeCommand.initialize

Angular 8 ng-build throwing MIME error with cordova

别等时光非礼了梦想. 提交于 2019-12-03 15:20:36
问题 While executing ng build --prod --base-href ./ for building my cordova app, the final output throws an error as below. Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec. I did end up fixing this by changing type module to text/javascript src="runtime-es2015.858f8dd898b75fe86926.js" type="module"> src="runtime-es2015.858f8dd898b75fe86926.js" type="text/javascript"> Is there something

Repository is not clean. Please commit or stash any changes before updating In Angular 8

时光毁灭记忆、已成空白 提交于 2019-12-03 10:18:59
Error Repository is not clean. Please commit or stash any changes before updating when i have updated from version 7 to Angular 8. Angular Guide for upgrade https://update.angular.io/#7.0:8.0 D:\app-test> ng update @angular/cli @angular/core npm cache verify Repository is not clean. Please commit or stash any changes before updating. Update Version PS D:\app-test> ng update Using package manager: 'npm' Collecting installed dependencies... Found 58 dependencies. We analyzed your package.json, there are some packages to update: Name Version Command to update -------------------------------------

ng serve is not working after Angular 8 update

非 Y 不嫁゛ 提交于 2019-12-03 10:18:40
Error Could not find the implementation for builder @angular-devkit/build-angular:dev-server ng serve Could not find the implementation for builder @angular-devkit/build-angular:dev-server Error: Could not find the implementation for builder @angular-devkit/build-angular:dev-server at WorkspaceNodeModulesArchitectHost.resolveBuilder (D:\angular-tour-of-heroes\node_modules\@angular\cli\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js:49:19) at ServeCommand.initialize (D:\angular-tour-of-heroes\node_modules\@angular\cli\models\architect-command.js:135:55) at async

Angular 8 using sails js websokcet (sokcet.io)

早过忘川 提交于 2019-12-02 23:17:12
问题 I want to connect angular 8 in front to sails js in backend through websocket. but my code doesn't work. may someone help on way in backend i just did following: in controller: /** * SocketController * * @description :: Server-side actions for handling incoming requests. * @help :: See https://sailsjs.com/docs/concepts/actions */ module.exports = { subscribe: function(req, res) { if( ! req.isSocket) { return res.badRequest(); } console.log('here is socket'); // sails.sockets.join(req.socket,

Angular 8: Restore scroll position when browser back button is selected in child component

早过忘川 提交于 2019-12-02 16:19:41
问题 I have a component consisting of a list of many cards (like a grid format). Upon scrolling down and selecting one of the cards, I would expect to return to the same scroll position when I press the browser back button. I'm unable to use Router's scrollPositionRestoration method as it is located in my child component. Appreciate your help! 回答1: Okay I found a solution after reading Angular 2 Scroll to top on Route Change. I just added a window.setTimeout as a temporary fix, even though I don't

ng-template with *ngFor issue in angular 8

烂漫一生 提交于 2019-12-02 16:18:15
问题 I want to create a table with dynamically generated columns. I used PrimeNg library for the grid. I opened many questions,but no one replied me,please help me to do this. I used with *ngFor to generate table column headers There are 2 arays. one for the row data and one for columns names. Here is my row data array.which contains one row uersSurveyAnswers: any = [ { userEmail: 'amara@gmail.com', qustns: [ { qNo: 1, ansrs: ['1'] }, { qNo: 2, ansrs: ['1', '0', '1', '1'] }, { qNo: 5, ansrs: ['2']

Is there anyway to send a json array to server side php and insert it's values in a table?

流过昼夜 提交于 2019-12-02 15:59:21
问题 i am using ANgular 8 in client side and PHP 7 in server side . i had problem to use the values of that array to insert them by query . i displayed the array by print_r and it show something like this: Array ( [0] => stdClass Object ( [idprod] => 8 [prix] => 2 [qte] => 1 [refCmd] => 35 ) [1] => stdClass Object ( [idprod] => 9 [prix] => 2.4 [qte] => 5 [refCmd] => 35 ) ) the question is how to insert every object of that array in table called regrouper ? <?php header("Access-Control-Allow-Origin