angular6

How to show tooltip on @ng-select/ng-select options

吃可爱长大的小学妹 提交于 2019-12-06 02:05:43
I am using @ng-select/ng-select@2.3.6 in my application and i have a very long text in array. So, the complete text not visible in dropdown list so I want to show the title/ tooltip over the each and every options I tried, let listArray = [{name: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s'}]; <ng-select placeholder="Select" (change)="onChange($event)"> <ng-option *ngFor="let list of listArray" title="{{list.name}}"> {{list.name}} </ng-option> </ng-select> But no luck you can achieve

How to define a highly scalable folder structure for your Angular 6 project?

跟風遠走 提交于 2019-12-06 01:52:26
问题 I am just learning more about angular 6 and its core features , I am confused a little bit about which folder structure I should USE for angular 6 , I have used different structures from different tutorials eg traversymedia, udemy and list goes on, everyone uses different folder structure depending on the project. here is basic folder structure from angular docs here is what I have tried after searching and searchning └───src ├───app │ ├───layout │ │ ├───admin │ │ │ ├───breadcrumbs │ │ │ └──

Angular 6 Library - bootstrap styles

岁酱吖の 提交于 2019-12-06 01:37:50
I'm currently experimenting with creating Angular 6 libraries and consuming them in other applications. It seems to be working well. I am following: https://medium.com/@SirMaxxx/angular-6-creating-a-shareable-control-library-6a27f0ebe5c2 A problem that I am having is adding dependencies to such libraries, in particular with bootstrap. What I am trying to do is to create a component library, which comes bundled with custom and 3rd party styles, however there does not seem to be a way to do that? I would expect to add references to bootstrap to angular.json file similar to below: "styles": [

Issue in adding Xsrf-Token in an Angular 6

主宰稳场 提交于 2019-12-06 00:17:03
Posting data from the form submit via API was successful. But after adding X-CSRF-TOKEN to the header and setting withCredentials: true resulted data were not posted to the script named insert.php Error: Failed to load http://localhost/simple_api/insert.php : Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin ' http://localhost:4200 ' is therefore not allowed access. The credentials mode of requests initiated by the

Angular Dropdown directive doesn't work

孤街浪徒 提交于 2019-12-05 23:25:06
I am using Angular 6.0.5 alongside with Bootstrap 4.1.1 and I added a directive for dropdowns. But I can't make it work in no way. I have seen a lot of similar problems here but none was for Bootstrap 4. this is the dropdown html: <div class="btn-group" appDropdown> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> Manage <span class="caret"></span></button> <ul class="dropdown-menu"> <li><a class="dropdown-item" style="cursor: pointer" (click)="OnAddToShoppingList()">To Shopping List</a></li> <li><a class="dropdown-item" href="#">Edit Recipe</a></li> <li><a

Angular 6 Dynamic Views with Auxiliary Routes and clean URL's

谁说我不能喝 提交于 2019-12-05 22:33:25
In my Angular 6 project, I have some components that have a sidebar, and some of them don't. I tried to do this with auxiliary routes and it worked, but the URL's are ugly as ...! -- What I do: const routes: Routes = [ { path: 'login', component: LoginComponent }, { path: 'search', component: SearchComponent }, { path: 'sidebar', outlet: 'sidebar', component: SidebarComponent } which gives me them possible URL's https://localhost:4200/login - (login without sidebar) https://localhost:4200/login(sidebar:sidebar) - (login with sidebar) https://localhost:4200/search - (search without sidebar)

How to downgrade angular7 to angular6

假如想象 提交于 2019-12-05 20:01:35
I have tried to downgrade angular 7 to angular 6 by running the following npm commands: npm uninstall -g angular-cli npm cache clean npm install -g angular-cli@6.1.1 However angular/cli 7 version is still displaying in my package.json file. I need help to downgrade angular7 to angular6 . You need to set the version numbers in your package.json for (at least) this packages "@angular/animations": "^7.0.0", "@angular/cdk": "7.3.3", "@angular/common": "^7.0.0", "@angular/compiler": "7.2.6", "@angular/core": "7.2.6", "@angular/forms": "^7.0.0", "@angular/http": "^7.0.0", "@angular/material": "7.3.3

Buliding dropdown/select dynamically via reactive forms angular 6

巧了我就是萌 提交于 2019-12-05 18:41:51
I have multiple (any number) dropdowns on the form that i need to build dynamically. All these must have a value selected, so need to apply required validator. Sample json [ { "FeatureCaption": "Style", "SelectedValue": "shaker", "FeatureList": [ { "FeatureId": "CHOOSE", "FeatureName": "Choose", "IsSelected": true }, { "FeatureId": "shaker", "FeatureName": "Shaker", "IsSelected": false } ] }, { "FeatureCaption": "Material", "SelectedValue": "std", "FeatureList": [ { "FeatureId": "CHOOSE", "FeatureName": "Choose", "IsSelected": true }, { "FeatureId": "std", "FeatureName": "Standard",

child parent communication best practices in Angular

本秂侑毒 提交于 2019-12-05 16:56:04
I'm trying to become better at Angular and I want to know the best practices between child-parent communication. My current app I want to work on is on Angular 6. I know I can communicate between child-parent components using @ViewChild, @Output or creating a service. Is there another way to do the communication? if not which one of those 3 is better and why? Here's a simple example: Child HTML <button (click)="onLinkedClicked();">Click me</button> Child TS import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; . . . export class showcaseMenuComponent implements OnInit

Refresh token (JWT) in interceptor Angular 6

…衆ロ難τιáo~ 提交于 2019-12-05 16:00:49
Initially, I had a function that simply checked for the presence of a token and, if it was not present, sent the user to the login header. Now I need to implement the logic of refreshing a token when it expires with the help of a refreshing token. But I get an error 401. The refresh function does not have time to work and the work in the interceptor goes further to the error. How can I fix the code so that I can wait for the refresh to finish, get a new token and not redirect to the login page? TokenInterceptor import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest}