Questions tagged [angular]

49869 questions
0

votes
0

answer
23

Views

Function always return true in prod mode

i'm building an app to make people book on some courses. I have an array in my component: public corsiSelezionati: {nome: string, sede:string, codice:string}[] I have an onChange() func that gets triggered every time a form has a change: onChange($event) { try { const nome = ($event.target.options[$...
Francesco Buccoliero
0

votes
0

answer
4

Views

ag-grid not loading at all in IE11 with Angular 7

My ag-grid works fine in all other browsers, but when I open it with IE it does not load at all. No error messages show in the console. Note that the rest of the Angular app loads just fine, just not the ag-grid-angular component` package.json { "name": "my-app", "version": "0.0.0", "scripts": { "ng...
zero01alpha
0

votes
0

answer
2

Views

How to add an Angular directive to rows in grid dynamically?

I have my DxDataGrid (DevExtreme) in an Angular 7 application and want add my custom directive for each data row. What options do I have? What is recommended? Without the directive, or before I created it, this was my code: onRowPrepared(e) { if (e.rowType === 'data') { // console.log(e); e.rowEleme...
TheViking
0

votes
0

answer
2

Views

Incorporating Two Angular Projects in One Ionic 4 App

I have a requirement to run 2 different angular projects in 1 Ionic App. The main reason for this is because they will serve as 2 different parts of the App and the second part of the app will be triggered by an android service, so I won't know from Angular side that it was triggered by the service....
Ruan
-2

votes
0

answer
38

Views

array in an array is not properly showing within my html

I am trying to make a breadcrumb component for angular7 but I can't get my array to properly show into my HTML and would like some tips because I can't find it on the internet. if you would be so kind as to help me I am still new to angular and can't think of a better way to make a breadcrumb compon...
Marc Roelse
0

votes
0

answer
27

Views

how to emit complete event from RxJS of(myArray) Observable

I came into a problem while working with Angular and Observable. I got a Basket page subscribing to an Observable of an array in a BasketService, containing my customers orders. When i click on the validate button, i empty my ordersArray but even though my Basket page has subscribed to my observable...
Julien FEGER
0

votes
2

answer
25

Views

Variable data not retained to bind in HTML even after assigning data to it inside a subscribe() function

I have below app-product.ts code written as below: @Component({ selector: 'app-product', template: ` {{products.prod_name | uppercase}} Details Description: {{products.prod_desc}} ` }) export class ProductComponent { products:any = []; constructor(public rest: RestService){ this.getProducts() } getP...
Onera
0

votes
3

answer
58

Views

Angular sandbox application read browser URL

Currently, I'm working on reading URL from the browser and assigning that as global URL, instead of hardcoding the base_url I need it to be read from the browser and patch that to the all the service with the URL. I have tried doing this and this code works but the problem is once the screen is relo...
Abhishek Ekaanth
0

votes
0

answer
7

Views

CORS issue upon clicking on One Signal push notification (web push)

I have integrated my angular 6 app with One Signal Push notifications. My index html file has the below code in the script tag. var OneSignal = window.OneSignal || []; OneSignal.push(function () { OneSignal.init({ appId: "xxxxxxxxxxxxxxxxx", }); }); OneSignal.push(['addListenerForNotificationOpened'...
Varun Pottigari
1

votes
2

answer
5.3k

Views

$http response header message

is it possible in anulgarjs to fetch the response header message? in a code similar to that $http.get(url) .success(){ something }.error(status,"headers text message)"{ alert(status+" "+"headers text message or a method to get it"; } in the alert i need to write somthing like that: 500 internal serv...
mautrok
1

votes
1

answer
53

Views

how do we filter items on observable?

model looks like below export class FileQueueObject { public file: any; // used any because selected file contain. public status: FileQueueStatus = FileQueueStatus.Pending; public progress = 0; public request: Subscription = null; public response: HttpResponse | HttpErrorResponse = null; constructor...
Var
1

votes
0

answer
21

Views

Angular 7 pipe(tap()) doesn't work the second time

I have this method getData() that returns an Observable: protected getData(): Observable { return this._service .getAllData() .pipe( tap(data => { this.items = data.Items; }) ); } The first time this function is called, it works fine. The second time, I have no explicit e...
E.Tiake
0

votes
0

answer
16

Views

Angular Firebase background message

I have a project with firebase push notifications. I use @angular/fire module. I'm receiving messages when the page is opened, but in the background, I get only push notification, but angularfire doesn't give me the message. And also I couldn't change the notification icon and title. I do it in fire...
Nay si
0

votes
0

answer
44

Views

SSL with Angular-cli

How does one trust the SSL certificates that are self generated by the NG serve command? Steps to reproduce: Enviroment (ng --version) Angular CLI: 7.3.1 Node: 10.15.1 OS: win32 x64 Angular: 7.2.4 Create a new project with ng new myApp. change the package.json to contain "start": "ng serve --ssl" ru...
Alex
0

votes
0

answer
7

Views

How can I use API call in *ngFor

I want to use temperature by city in my table as follows. I have other data hardcoded ,however, temperature data needs to be fetched from API. I am getting the data successfully from API with given city name, but trying to figure out how I can render it in table. Component file export class HomeCom...
Mitesh
2

votes
1

answer
21

Views

Errors are not captured with try catch error handling

I am building a demo angular 7 application where i have generic POST method. While I am able to call this method it seems that none of the errors (401,500 etc) are being captured in the catch block. I can see in the network tab that the post is failed. What is wrong with the below code? // Generic...
Jim
0

votes
0

answer
5

Views

How to test activatedrouted and router together in angular 7?

I want to test my title component which displays the datas of each route. This is my spec.ts import { async, ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { TitleComponent } from './title.component'; i...
user9714967
1

votes
0

answer
6

Views

How do we integrate ckfinder in ckeditor in ANGULAR 6?

Hi I have been trying to integrate the ckeditor5 with angular app and followed instruction given in the document. https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/angular.html https://ckeditor.com/docs/ckeditor5/latest/features/image-upload/ckfinder.html Normal ckedit...
Prince Asokan
0

votes
0

answer
5

Views

NG1 UI-ROUTER: change parameter for controller and back to route

I have a state: $stateProvider .state('i18n.node', { url: '/node-{action:(?:search|add|edit)}/{key:.*}', params: { action: { value: 'search' }, key: { value: '', squash: true, raw: true } ... I need to replace a key / char with . for controller. It's not a problem, and I can do it like so: resolve:...
Kindzoku
1

votes
0

answer
12

Views

Jasmine trigger the search member function but can't get any response or error

I am new to Jasmine and I am testing via UI so after entering the values in the search input field and triggering keyup event the search function is called which I confirmed by logging at different points but the API call is not triggered which is inside the search function. Do I have to use await o...
Sohail
1

votes
0

answer
8

Views

Component cannot subscribe to event that is triggered from another component

I have a service. The communication provides via the service. I provide service in a common module. But UserProfileComponent cannot subscribe to the event. here are the codes export class UserProfileComponent implements OnInit{ ngOnInit(): void { this.userService.currentMessage.subscribe(message =>...
weka bird
0

votes
0

answer
12

Views

Can't resolve '@firebase/firestore-types' in Angular

I'm doing a web application in Angular 6 and in my classes I have import {Timestamp} from '@firebase/firestore-types'; to save and to present dates. For example: this.createdAt = Timestamp.now(); I receives the error: Module not found: Error: Can't resolve '@firebase/firestore-types' Inside my packa...
RRGT19
5

votes
1

answer
106

Views

Angular Animation Performance State/Transition vs Query

I am currently taking a deeper dive onto angular animations, and I couldn't figure out if there can be a recommendation in relation to performance at how to attach the animation to elements/components 1. State/Transition .html .ts trigger('animation_foo', [ state('true', style({...}), state('false',...
Jonathan Stellwag
0

votes
0

answer
5

Views

How to fetch data from firestore map inside an array using Angular

I have my data in firestore as: Firestore database structure A collection with a document that contains an array labeled polyline with a map. How do I retrieve and then iterate over the latitude and longitude values for a polyline in Angular(Angular 6+).I'm accessing the database collection from my...
lifespunchingbag
1

votes
1

answer
805

Views

AngularDart: How to force page re-rendering similar to $digest in AngularJS?

I have a page with simple component: Test Status {{ 1 | enum }} The filter 'enum' use loads data that using XHR. Therefore, at the page load time the data is available (say, it takes a second). So, while data is not there the filter returns null. How can I trigger the controller to re-evaluate the t...
Mikhail Turilin
1

votes
3

answer
1.8k

Views

How to call parent method from model controller

I have one controller named "contractController" contractController contains a method save() contractController opens one model window with controller named "PopUpcontroller" from PopUpcontroller i want to call save method on contractController tried to call save method like $parent but nothing work...
nidhin
1

votes
1

answer
2k

Views

Dynamic loading of controller + factory in angularjs

I am developing angularjs application that should be possible to extend with "addins". In the simplified case addin is just a pair of js+html files. Each addin should have one or more controllers and one or more factories. Below is an example of adding with one controller and one factory: JS: angula...
Amid
1

votes
1

answer
2.5k

Views

Angular UI Typeahead - Manually clear/hide dropdown

My use case is rather simple. I'm using the typeahead directive as a search box and want to manually clear/hide its dropdown when hitting enter (and you haven't selected anything) - much like Google does it. P.S. the text in my search box needs to remain intact when clearing the dropdown
Markus Coetzee
0

votes
0

answer
21

Views

How to achieve scroll feature (like in Gmail)

I am trying to achieve scroll functionality same as when we compose email in Gmail. Here, when we enter text in gmail "Compose" and reach at the end near toolbar(at bottom) the cursor stops at above toolbar and scroller reaches at the bottom. However, user can still enter the text which goes upward...
Mahi
0

votes
0

answer
16

Views

Refresh side bar menu after saving data in Angular 6

I want to keep updated my sub menu when I adding item into my page. Every time I add any item into my page its added into sub menu. But I need to reload the whole page to see it. Is there any way it will also update the sub menu while I update my page. App-navigation.service.ts getmenu() = AppMenu {...
S.Rusdana
0

votes
1

answer
14

Views

First div transparent background - Angular 7

I know that there are few answers related to this topic but I have not found any valid one I am using Angular 7 as a Framework and I am dealing with a problem. I have two components: - Header - Landing app.component.html I have set in my app.component.html both of them to show them continuously: My...
Mario
0

votes
0

answer
3

Views

ngx-materialize Switch Tabs programmatically

i m working with Angular 7 and ngx-materialize (ngx-materialize GitHub) The thing is i made a form with tabs and i want to chenge the active tab with a button, for accessibility purpose, the idea is that in the last input 'tabs' to the button and if the form is valid can continue to the other tab. f...
Sandy Veliz
3

votes
0

answer
21

Views

Is it a good practice to use facade pattern in angular for many services injecting in a class?

I have a dynamic form component that receive many services using angular DI system: export class CityFormComponent extends BaseForm implements OnInit { constructor( protected appConfig: AppConfig, protected httpService: CityService, protected snackBar: MatSnackBar, protected componentFactoryResolv...
HDM91
1

votes
3

answer
1.5k

Views

Angular ui-router… Display default tab

I am arriving on bookDetails state form some other link. Here bookDetails state's template has links for different tabs (or templates). And associated controller EditBookController has a json file using which I am building forms in different tabs with states like bookDetails.basic and bookDetails.pu...
1

votes
2

answer
1.9k

Views

Return promise in AngularJS $http.get?

I'm trying to return the values I get in my $http.get but I can't get it to work... $scope.getDecision = function(id) { var defer = $q.defer(); $http({ method: 'GET', url: 'http://127.0.0.1:3000/decision', params: {id: id}, headers: {'Content-Type': 'application/x-www-form-urlencoded'} }).success(fu...
Cleaning
1

votes
1

answer
3.4k

Views

Angular ui-grid row selection call function

I am adding a ui-grid and want to be able to select a row and call a function. I also need to send to the function the data from the entire row (only a couple of columns are actually displayed), however I need the complete row passed to the function. here are my options for the grid so fa: $scope.gr...
lascoff
1

votes
1

answer
2.4k

Views

Leaflet-draw : Create editable layers

My objective is to have a map to which I can add markers/polygons/... These elements will be saved into an Object for saving. The drawn elements can later be edited/deleted or added to. I have successfully managed to create/edit/delete them, but when I init my map with the saved objects they can't...
GuillaumeS
0

votes
3

answer
46

Views

trying to filter an array

I have this code: console.log(this.productlist[this.productlist.length-1] === product); //says: true this.productlist == this.productlist.filter(p => p !== product); console.log(this.productlist); //the product is still in the list I want to filter the product(which is the last item in the list) ou...
nbar
0

votes
1

answer
28

Views

Is there an onResume method in Angular similar to Android View Lifecycle?

In my application, a user can switch between multiple tabs. Each tab is linked to a different component. Example: User is on URL1, on button click he navigates to URL2 in a new tab. When I manually switch back to URL1, is there any method which is triggered just like onResume function in Android?
Anirudh
0

votes
1

answer
32

Views

Angular 7 Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays

Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays. I'm getting the above error while retrieving data from the database. I tried all the remaining responses but I'm not getting the exact solution. Please provide suggest...
sun

View additional questions