angular

Form Validation Angular 4

假如想象 提交于 2021-02-20 04:44:06
问题 So, I was attempting to use the following example: https://github.com/agiratech/angular4-reactive-form-exercise2/ However, when I implement it, and submit my form, no errors show anywhere on the screen. Below you will find all associated code that I can think of that relates. I'm looking for how to get the errors to show on the screen. I'm fairly new to Angular 4, so any help would be appreciated. pages.module.ts import ... import { FormsModule, ReactiveFormsModule } from '@angular/forms';

Angular 4 JS script not working after changing route

[亡魂溺海] 提交于 2021-02-20 04:42:45
问题 I try to load a script via angular-cli to sync two divs. When page is loaded for the first time, the script is working fine. Aftter that I change the route via Navigation. When going back to the first page, the script is not working anymore. Angular CLI: "scripts": [ .... "assets/scripts/scrollsync.js" ] scrollsync.js: $(function() { $('#column-item-container').on('scroll', function () { $('#row-lead-container').scrollTop($(this).scrollTop()); }); $('#column-item-container').on('scroll',

How to load ngOninit after binding the api's?

时间秒杀一切 提交于 2021-02-20 04:41:11
问题 I am trying to load a Crud screen which contains two api's. I want to load the ngonit after loading the two(or more api's).This below code shows the loading of the Rule types. I have similar query for Grouptypes. But I dont want to use the setimeout function for loading the api's.. public ngOnInit(): void { console.log(this.data); this.isNew = this.data.isNew; setTimeout(() => { this.getRuleTypes(this.data); this.getGroupTypes(this.data); }, 1000); console.log(this.ruleTypeselected ); console

Angular Child Route not changing

对着背影说爱祢 提交于 2021-02-20 04:25:26
问题 I am designing a website with angular4, and have a component that inside uses the @angular/material sidenav. Within that sidenav i have <router-outlet></router-outlet> . my app.module has all the necessary imports and declarations, I have a app-routing module that contains the following code for the component: const appRoutes: Routes = [ { path: 'reg', component: RegComponent, children: [ { path: ':info', component: RegInfoComponent }, { path: ':ther', component: RegTherComponent } ]}, ]; I

Angular Lazy Load External JS files with Angular Universal

回眸只為那壹抹淺笑 提交于 2021-02-20 04:25:14
问题 https://maps.googleapis.com/maps/api/js?libraries=places&key=XXX This is inside index.html file, but i want to lazy load this script, because that module is lazy loaded and it's really not necessary for all users. I can't use trick with directly accessing the DOM and appending script el. because I want to use Angular Universal ( SSR ). 回答1: You can access the DOM even if you are using SSR. Add this to your lazy loaded module module or one of the components of your lazy loaded module import

File Upload in Asp.net core 2.0 issue creating 0 byte Image

不想你离开。 提交于 2021-02-20 04:23:45
问题 I, am using angular 5, with asp.net core 2.0. I, am trying to upload the file to the server. The code update the file to the server. But with 0 kb of data and sometime it upload the file. The file size is not large. Its in KB. Here is the Angular code public QuestionPostHttpCall(_questionPhotoVM: QuestionPhotoViewModel): Observable<GenericResponseObject<QuestionPhotoViewModel[]>> { const formData: FormData = new FormData(); formData.append('FileUpload', _questionPhotoVM.FileUpload); formData

How do I implement systemjs in Angular 6+?

允我心安 提交于 2021-02-20 04:12:37
问题 I'm trying to learn how to make plugins work in Angular, however after adding systemjs I get the following error: Uncaught ReferenceError: SystemJS is not defined I implemented systemjs like this: import { System } from 'systemjs'; declare const SystemJS: System; import * as angularCore from '@angular/core'; import * as angularCommon from '@angular/common'; import * as angularCommonHttp from '@angular/common/http'; import * as angularForms from '@angular/forms'; import * as angularAnimations

How to make a massive delete in angular 4 with an array of ids

人盡茶涼 提交于 2021-02-20 04:12:33
问题 I'm trying to make a massive delete, in order to do that I have an Array<number> of the ids I want to delete. I can't pass this array as a parameter to the method this._httpService.delete(uri,options) . The type of _httpService is Http . So I'm looping the array and inside the loop I'm making single calls, but each call is async and I have certain logic to run when the loop ends. 回答1: Actually you can send the id array in the body of a DELETE request, according to this answer, like so: http

How do I implement systemjs in Angular 6+?

戏子无情 提交于 2021-02-20 04:11:58
问题 I'm trying to learn how to make plugins work in Angular, however after adding systemjs I get the following error: Uncaught ReferenceError: SystemJS is not defined I implemented systemjs like this: import { System } from 'systemjs'; declare const SystemJS: System; import * as angularCore from '@angular/core'; import * as angularCommon from '@angular/common'; import * as angularCommonHttp from '@angular/common/http'; import * as angularForms from '@angular/forms'; import * as angularAnimations

How to make a massive delete in angular 4 with an array of ids

情到浓时终转凉″ 提交于 2021-02-20 04:08:05
问题 I'm trying to make a massive delete, in order to do that I have an Array<number> of the ids I want to delete. I can't pass this array as a parameter to the method this._httpService.delete(uri,options) . The type of _httpService is Http . So I'm looping the array and inside the loop I'm making single calls, but each call is async and I have certain logic to run when the loop ends. 回答1: Actually you can send the id array in the body of a DELETE request, according to this answer, like so: http