Search Posts

AngularFirebaseAuth : Calling server api just after firebase auth?

My auth is based on 2 things : firebase auth (email/password) call on a server API to retrieve full customer entity from BDD and from firebaseID (user must exists) So a user will be “authenticated” if these two conditions are met. I also have authGuards based on a isAuthenticated() returning an Observable (because on a page refresh, guard must wait for the auth to be finished before redirecting the user anywhere). Problem : I can’t […]

Does AngularJS promise scheduling work with `async`/`await`?

TypeScript constantly suggests that I change my AngularJS service code to async/await functions. My understanding is that using the await keyword is totally fine with third-party promises, since it is just syntax sugar for calling then. However, I normally return Angular promises because they are necessary to play nicely with the digest cycle. This code gives me an error because async functions wrap their contents in an ES6 promise. Will this matter for Angular scheduling, […]

Can an angularjs directive compile a new element which is assigned a second directive

EDIT: Each of the directives below will need to apply ng-model bindings in the elements they create to whatever controller is assigned to the page they are on. I’ve updated the code to reflect that. I’m trying to create some dynamic HTML using directives. A simple case worked fine in the case of a single directive but now I’m trying to get a little fancier and I’m not sure how this should work. Looking at […]

How can I pass a variable between angularjs views?

I have a .slim file with AngularJS code. In this file, there’s different views. In the upload view, I have two radio buttons and I would like to keep the value of the radio selected in my edit view. I read that I need a service, but I don’t know Angular (and i’m pretty bad with javascript) so it’s a bit difficult to understand and know what I have to do… This is my whole […]

I want to show the country name in ag grid as a dropdown,

This is my JSON response ‘metaDataFields’: [ { ‘key’: ‘airport_id’ }, { ‘columnA’: ‘code’ }, { ‘columnB’: ‘short_name’ }, { ‘columnC’: ‘long_name’ }, { ‘columnD’: { ‘name’: ‘country_id’, ‘values’: [{ ‘name’: ‘United States of America’, ‘country_id’: 1, ‘code_short’: ‘US’, ‘code_long’: ‘USA’ }, { ‘name’: ‘Canada’, ‘country_id’: 2, ‘code_short’: ‘CA’, ‘code_long’: ‘CAN’ }, { ‘country_id’: 3, ‘name’: ‘India’, ‘code_short’: ‘IN’, ‘code_long’: ‘IND’ }, { ‘country_id’: 4, ‘name’: ‘Ireland’, ‘code_short’: ‘IE’, ‘code_long’: ‘IRL’ } ] } } […]

How to unify the requests’ files in angularJS? [duplicate]

This question already has an answer here: Combine and Minify Multiple CSS / JS Files 13 answers I’m using angularjs in the project I’m working on (which started 3 years ago), and it is currently so big that it’s making 438 requests to the server and making it fall frequently when three or more people open it at the same time in production. We don’t have enough time at the moment to migrate the project […]

Why am I receiving a CSP Error in my Google Apps Script File?

I’m having an issue with my Google Apps Script file. Its essentially mirroring a Room Reservation system and up until recently it started to have some issues. I’m having a Content Security Policy issue that shows when I try to run it on FireFox. When I go on Chrome, I get a different error: I have an Admin Console, that gives me the option to accept or decline Room Reservations. Currently, the only account that […]

Angular JS Unit testing: how to test function in service that doesn’t return

I’m sorry for possible duplicate, I didn’t find any solution for my problem. I’m need to write tests for a service in Angular JS app. So I have one main function that returns and uses as an external method. And a couple help functions for external. So how can I call and test things inside help functions (subFunc)? service.js function TestService() { return { mainFunc: mainFunc }; funcion mainFunc() { //do some and call subFunc() […]

Md-chips email validation

Md-chips email validation How to create an email validation for md-chips? My expression below is not working, since, the ng-keypress directive is called whenever I type something. Suggestions? <div class=”row”> <div class=”col-md-12″ ng-cloak=””> <md-context class=”md-padding”> <md-chips md-separator-keys=”ctrl.customKeys” ng-keypress=”ctrl.validateEmail()” ng-model=”ctrl.ConfiguracaoRegra.Emails” md-max-chips=”20″ placeholder=”Inserir um email…” ng-required=”true” type=”email”></md-chips> </md-context> </div> </div> vm.validateEmail = function (keyEvent) { var emailValue = angular.element(“.md-input”).val(); var reg = /^[_a-z0-9]+(.[_a-z0-9]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})$/; if (reg.test(emailValue)) { vm.isEmailValid = true; } else { vm.isEmailValid = false; } }; […]

Nodejs + API Rest Structure

I have a legacy system that provides an api with some queries in rest/json (Delphi) in which I will need to consume this data already available. Then build an app using angular + nodejs, and I would like my application (client) to communicate only with my web-server on nodejs, and the web-server nodejs communicate with api, I will try to explain. MyApp -> web-server NodeJS -> api rest legacy client -> (web-server NodeJS port 80) […]

Next Page » « Previous Page