angular6

Facing issue while migrating angular 5 to angular 6 in .net core 2.1 project.

倾然丶 夕夏残阳落幕 提交于 2020-03-05 08:04:28
问题 We are using angular SPA template. Facing issue while migrating angular 5 to angular 6 in .net core 2.1 project. For now I have updated packages, Old version package.json { "name": "projectname", "private": true, "version": "0.0.0", "scripts": { "test": "karma start ClientApp/test/karma.conf.js" }, "dependencies": { "@angular-redux/form": "^6.7.0", "@angular-redux/router": "^6.4.1", "@angular-redux/store": "6.6.0", "@angular/animations": "^5.2.0", "@angular/cli": "^7.1.2", "@angular/common":

How can I load the content before the footer?

99封情书 提交于 2020-03-05 06:40:07
问题 My footer is getting loaded before the content is loaded. I have multiple buttons in my navbar which when click opens a new component. When the user hits the events, it will emit after the event is loaded from the api. At this time footer is loading fine. But after that I go to another link lets say special then footer is loading before the event. I tried like below: events.component.ts export class EventsComponent implements OnInit { events = []; constructor(private _eventService:

How to send array of files and data to API server with FormData

a 夏天 提交于 2020-03-05 04:13:34
问题 I hava a fileUploader component with angular 6 and in the server side I use the Asp.Net Core 2.0 . Since the my files has larg size, I use the FormData . I can send a file with data to server very well. with this code: component: export class AttComponent implements OnInit { constructor(private attService: AttService) { } uploadFile() { var entity = {}; entity.ID = 123; entity.ATT_ID = 456; entity.REFERENCE_TYPE = "referenceType"; entity.REFRENCE_ID = "referenceID"; this.attService.UploadFile

Angular 6 and typescript child class extends from parent class and banish child variables

岁酱吖の 提交于 2020-03-04 21:36:12
问题 I have an abstract class called ParentService and its child class ChildService as follows: ParentService import { Injectable } from '@angular/core'; import { MyModel} from './mymodel-model.service'; @Injectable({ providedIn: 'root' }) export abstract class ParentService { constructor() { } word:MyModel = { "AA":"AA", "BB":"BB", } } ChildService import { Injectable } from '@angular/core'; import { MyModel} from './mymodel-model.service'; import { ParentService } from './parent.service';

Angular 6 error: CSSSyntaxError - Failed to compile

倾然丶 夕夏残阳落幕 提交于 2020-03-02 10:08:33
问题 Description I am receiving an error for the relative path in the url() that I mention for the 'background' property. When I use an absolute path for it, seems to be working fine. Error Message ERROR in ./src/styles.scss (./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/lib/loader.js??ref--15-3!./src/styles.scss) Module Error (from ./node_modules/postcss-loader/lib/index.js): (Emitted value instead of an instance of Error) CssSyntaxError: /home

how to pass data from angular material dialog to parent component?

旧城冷巷雨未停 提交于 2020-02-27 05:19:42
问题 I'm using angular 6 and I have a button which opens a dialog. in my dialog, I have a form that gets user's data and then I have two buttons to submit and cancel. I tried to show my form's data in the console but it returns undefined! whats the problem? here is part of codes: main.component.ts: import { Work } from '../../../../classes/work_shift'; import { DialogContentComponent} from './dialog-content/dialog-content.component'; export class WorkShiftsComponent implements OnInit { shifts:

PHP Session doesn't work in Angular 6 project

本小妞迷上赌 提交于 2020-02-25 07:09:26
问题 I am using angular 6 for frontend and PHP for backend (WAMP) and I want to make a login system. When someone enters valid credentials I want him to get redirected to http://localhost:4200/home I have auth.php which sets the session variables when someone enters valid username/password and verify.php to check if the session variables are set. Although the app redirects me to home, verify.php can not see the session variables. Those are my files: login-form.component.ts loginUser(event) { const

PHP Session doesn't work in Angular 6 project

与世无争的帅哥 提交于 2020-02-25 07:09:09
问题 I am using angular 6 for frontend and PHP for backend (WAMP) and I want to make a login system. When someone enters valid credentials I want him to get redirected to http://localhost:4200/home I have auth.php which sets the session variables when someone enters valid username/password and verify.php to check if the session variables are set. Although the app redirects me to home, verify.php can not see the session variables. Those are my files: login-form.component.ts loginUser(event) { const

Angular HTTP Interceptors - Redirect to Login page and skip further code execution

霸气de小男生 提交于 2020-02-25 06:10:12
问题 I have developed the Angular 6 application. Implemented the JWT token authentication using Web API. Also implemented the HttpInterceptor to keep watch on request and send the token in every request. @Injectable() export class HttpRequestInterceptor implements HttpInterceptor { constructor(private router: Router) { } intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { var token = localStorage.getItem("bearerToken"); if (token) { const newReq = req.clone( { headers

Angular 2+ - Tree table using API

 ̄綄美尐妖づ 提交于 2020-02-25 04:03:50
问题 I have three Apis for categories,subcategories and policies. For eg: "https://restapi.com/project". 1. Category In the case of category, I have to pass the body(raw data) as above json for the above Api { "startIndex":"1", "count":"150", "groupBy":"category", "searchTerm":"PROJECT:project1" } Api Response : Listed out all categories { "data": [ { projectName:null, categoryName: category1, subCategoryName:null, controlName:null }, { projectName:null, categoryName: category2, subCategoryName