Re: [AngularJS]

2019-05-25 Thread Kiflemariam Andom
What's hard about pipe? Pipe is the simplest filter. Just create one and re-use it. Let me know if you need help. On Thu, 23 May 2019 at 04:45, islem GUESMI wrote: > hay guys , i want to add filtre in my table ! i don't inderstand the pipe > i want another simple method please !! > Islem GUESMI

[AngularJS] make successive http calls that depend on each other

2019-06-08 Thread Kiflemariam Andom
Hello, While my solution is working, it is a bit hard to follow and just ugly to look at. It is on Angular 5. All the 3 apis reply text. The steps are the following: Call api1(). If successful: it returns a simple text 'ok' it will create a server side cookie. Then call api2() which makes use

[AngularJS] Waiting for google.accounts.com to finish before calling pouchdb methods

2019-06-10 Thread Kiflemariam Andom
Hi, I am using google social login in my pouchdb driven app. The thing now is I noticed that google tries to establish itself and perhaps I am wrong, in that insistance, the method that creates my pouchdb doesn't get called on time. While I am not 100% sure, I want to eliminate that possiblity.

[AngularJS] conditional observables nesting

2019-06-22 Thread Kiflemariam Andom
Hi, I am getting 'undefined' in one of my nested calls. It is sort of ugly to follow thru so bear with me. The application needs to do: 1. valid the google email is valid in the backend (it is custom domain). If valid, it sets a session that my client/front end don't have access to. 2. if email

[AngularJS] mocking a method in the same class during unittesting

2019-06-23 Thread Kiflemariam Andom
I have this class service in Angular 6: export class AppService { setValues(): Observable { const vm: any = this; return new Observable(observer => { vm.currentValues().subscribe(data => { // continue modifying data and reset it }); }); }

[AngularJS] updating pouchdb local document raising 409 and not reflecting changes in database but in revisions

2019-07-20 Thread Kiflemariam Andom
Hi Sander and All, Hope your weekend is doing well. Can someone help me please with pouchdb please. It is driving me nuts. You can see my code here https://stackblitz.com/edit/angular-akrcz9 What happens is I can have any number of app settings so I might update just one field of the document.

[AngularJS] unit testing a method that makes use of angular-social-login

2019-08-10 Thread Kiflemariam Andom
Hi, Perhaps more than the library alone, I would love a general answer as on how to go about testing such methods. Basically, I have a method that simply returns details of a google user - as seen below. export class GoogleLoginComponent implements OnInit { @Output() userDetails = new Even

[AngularJS] mocking auth2.attachClickHandler of gapi

2019-10-09 Thread Kiflemariam Andom
Declaration: this is part of my assignment for an online class that is already submitted for grading but it has already failed on my setup so...i will be asked to redo it until I get it but i don't have any other idea after a week. Background: I am not supposed to change the code base. I am sup

[AngularJS] Re: mocking auth2.attachClickHandler of gapi

2019-10-11 Thread Kiflemariam Andom
Hi Sander, Thanks so much. I totally forgot my spec file, which I did. It had googleUser class already but I think I didn't use it right. Can you have a quick look when you are free? On Wednesday, 9 October 2019 03:07:28 UTC-7, Kiflemariam Andom wrote: > > Declaration: this is

[AngularJS] Re: mocking auth2.attachClickHandler of gapi

2019-10-11 Thread Kiflemariam Andom
.querySelector("#google-login"); window["gapi"] = { load(auth2, callback) { return null; }, auth2() { function init(gapiInit){ return null } }, }; return { comp, fixture, de, el, btn }; } }); On Wednesday, 9 Octobe

[AngularJS] unit-testing a method that contains a promise in it

2019-11-19 Thread Kiflemariam Andom
Angular 2. My component contains the following piece of code: export class SectorComponent implements OnInit { let myList = []; let loading = false; refresh(){ this.loading = true; const that : any = this; this.dataService.products().subscribe(products=>{ that.myList= products; console.log

Re: [AngularJS] unit-testing a method that contains a promise in it

2019-11-20 Thread Kiflemariam Andom
oh never mind, solved it with (done). Cant believe it. On Tue, 19 Nov 2019 at 05:18, Kiflemariam Andom wrote: > > Angular 2. My component contains the following piece of code: > > export class SectorComponent implements OnInit { > > let myList = []; > let loading

[AngularJS] unit testing a promise method that implements .toPromise() on an http call

2020-02-29 Thread Kiflemariam Andom
My method is simply like this in angular 5: public login(data): Promise { const vm : any = this; return new Promise((resolve, reject) => { let url ="www.example.com" vm.http.post(url, data).toPromise().then( resp => { resolve(resp); }).catch(err=>{

Re: [Angular] How to Sovle this Error

2020-09-13 Thread Kiflemariam Andom
Allow CORS on your backend for your angular app On Sun, Sep 13, 2020, 3:05 PM Swapnil wrote: > *Access to XMLHttpRequest at 'http://localhost:53574/api/User > ' from origin 'http://localhost:4200 > ' has been blocked by CORS policy: No > 'A

Re: [Angular] passing in JWT Token to get response Angular?

2021-02-14 Thread Kiflemariam Andom
Just do. Bearer tokenvalue Not bearer token tokenvalue On Sat, Feb 13, 2021, 10:28 PM john.mb...@gmail.com < john.mbiddu...@gmail.com> wrote: > Hi > > So far I have this in my service file: > > *getProfile() {* > *const token = localStorage.getItem('token');* > *const header = new HttpHeaders().s