angular8

How to Upload File from Angular to ASP.NET Core Web API

不羁的心 提交于 2020-01-03 16:14:15
问题 Similar questions have been asked but after looking through all of those and many blog posts on the subject I have not been able to figure this out so please forgive me. I am creating a simple blog with (for the purposes of this question) two parts, a front end SPA in Angular 8 and a back-end API in ASP.NET Core 3. In one part of my front end I am attempting to upload an image to be used as the image for a newly created blog. When I try to upload an image, the resulting IFormFile in the

Get route parameters Angular?

自作多情 提交于 2019-12-30 07:49:23
问题 Routing rules are: const routes: Routes = [{ path: "", component: SkeletonComponent, children: [{ path: "dictionary", component: DictionaryComponent, children: [ { path: ":dict/:code", component: VersionsComponent }] }]; URL looks like: http://localhost:4200/dictionary/Gender/5 Where Gender is parameter: :dict and 5 is parameter :code . I tried to get parameters inside component VersionsComponent : ngOnInit() { console.log(this.activateRoute.snapshot.params['dict']); console.log(this

How to use the activated route's data DIRECTLY in the HTML template containing the RouterOutlet?

纵饮孤独 提交于 2019-12-28 06:52:23
问题 This one took me a while to figure out, so I hope to save someone's time by sharing the solution in the SO's Q&A way. Here it goes: Goal I have an Angular8 web application, where I use the RouterModule to navigate between the components. Here is how my routes are defined: const routes: Routes = [ { path: 'moo', component: AppMooComponent, data: { title: 'Moo Section', desc: 'Moo is the first example component.' } }, { path: 'boo', component: AppBooComponent, data: { title: 'Boo Section', desc

Issue when migrate Angular 4 with system js and MVC to angular 8

三世轮回 提交于 2019-12-25 18:25:17
问题 I am using Angular 4 with system.js with MVC. My Project structure is same as below link: http://www.developerin.net/a/53-Programming/123-Integrate-Angular-with-ASP.NET-MVC# Now I want to upgrade it to Angular 8. For this I used below links: https://www.talkingdotnet.com/upgrade-angular-4-app-angular-5-visual-studio-2017/ https://update.angular.io/#4.0:8.0 But it not working for me. DO I need to add angular.json OR Do I need to remove system.js? With System.js, Can I upgrade it to Angular 8?

Store Multiple Validators into a Constant in Angular 8 Reactive FormBuilders

匆匆过客 提交于 2019-12-25 01:46:46
问题 How do I store Multiple Validators into a Constant and use in Reactive FormBuilder? The following will apply 1 validator. Store and Use Regex Const Validator in Angular 8 Reactive Formbuilder export const ZipValidation = Validators.pattern(/^\d{1,5}$/); 'ZipCode': [null, [Validators.maxLength(16), ZipValidation]], We need to store a whole multiple array into a constant. This is multiple validators for latitude and longitude. Validators.maxLength(32), Validators.min(-90), Validators.max(90),

External file loading reference loading issue due to dynamic routing in angular?

↘锁芯ラ 提交于 2019-12-24 20:52:47
问题 I am Using Angular Universal project. In that i have configured fully dynamic routing like below. { path: ':locale', component: HomePageCategory }, { path: ':locale/:id', component: HomePageCategory }, Now i have added PWA so manifest reference was added in html file like below. <link rel="manifest" href="./manifest.webmanifest"> issue raised like below 1. Failed to load resource: the server responded with a status of 404 (Not Found) 2. Manifest: Line: 1, column: 1, Unexpected token. can you

Angular8 i18n for placeholderLabel text

坚强是说给别人听的谎言 提交于 2019-12-24 11:29:52
问题 How to add i18n in ngx-mat-select-search palceholderLabel <div class="form-group col-md-6 mb-lg-5 mb-4"> <mat-form-field class="example-full-width w-100"> <mat-select (selectionChange)='vehicle_maker_updated($event)' formControlName="vehicleMakerValue" placeholder="Motor Make" i18n-placeholder> <mat-option> <ngx-mat-select-search formControlName="vehicleMakerFilterInputValue" placeholder="Select Motor Maker" [noEntriesFoundLabel]="'No matching vehicle makers found'" (ngModelChange)='filter

Angular 8 fails to build after migration from Angular 7

天大地大妈咪最大 提交于 2019-12-24 00:33:33
问题 After I migrated my project to Angular 8, the build fails with this strange error: ERROR in HostResourceLoader: loader(C:/myapp/cli/src/app/pages/user-home/user-home.component.html) returned a Promise i 「wdm」: Failed to compile. but when I save any file the application builds ok after recompiling: i 「wdm」: Compiling... i 「wdm」: Compiled successfully. So initially it fails to load the template file specified in templateUrl at this specific line in Angular Compiler resource loader: https:/

d3.js runtime error after upgrade to Angular 8

▼魔方 西西 提交于 2019-12-22 04:30:36
问题 I am experimenting with upgrading my Angular 6 application to Angular 8. My code compiles, but I immediately receive a run-time error " d3.js:8 Uncaught TypeError: Cannot read property 'document' of undefined ". The line failing in d3.js is var d3_document = this.document; . This leads me to believe that Angular 8 is running d3.js in strict mode. I have the latest version of the d3 node module ( "d3": "3.5.17" ), and it apparently does not support strict mode; my understanding is "this" is

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

爷,独闯天下 提交于 2019-12-20 17:25:04
问题 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,