Re: [AngularJS] How to do a function call with ng-if or is it not possible?

2016-03-30 Thread James Drinkard
That worked, thanks! So is this acceptable as a best practice or is there a better way to do this? James -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[AngularJS] How to do a function call with ng-if or is it not possible?

2016-03-30 Thread James Drinkard
I'm new to angular 1x and I have some complicated display business logic using multiple and nested ng-if statements that I had put into my web page, just to get it working. It didn't pass the code review and the suggested refactoring was to call a service to handle this. I created the

[AngularJS] Where did this pattern originate, using Two return statements with $http.post

2017-07-28 Thread James Drinkard
I recently had a requirement to create a custom component that would make a REST call to an API and then return data (a token) back. I'm working with Angularjs 1.4.2. So I created a custom directive that called a service to do this, however, I kept failing to return the data back to the

[AngularJS] Re: Where did this pattern originate, using Two return statements with $http.post

2017-07-28 Thread James Drinkard
Well I totally missed that! Yes I knew a little about promises, but didn't see where having two return statements fit in. In my code I'm returning the $http.post, (return $http) which it seems to be the promise object itself, and returning the response which contains the data in .the .then

[AngularJS] Re: How to redirect to another domain from $http.post success callback?

2017-08-14 Thread James Drinkard
This is more involved than I first thought. Here is an overview of what I'm trying to accomplish. My original call to a restful login API returns a token, then I dynamically create a return url from another service function and then I need to redirect to an external URL outside of the

[AngularJS] How to redirect to another domain from $http.post success callback?

2017-08-04 Thread James Drinkard
I'm using Angularjs 1.4.2 and I need to redirect to another URL after $http.post success callback. I know I can use something like: $window.location.href = "http://google.com;, but in this case I think need to call a function in the service from the custom directive to get the URL dynamically.

[AngularJS] Re: How to redirect to another domain from $http.post success callback?

2017-08-08 Thread James Drinkard
Okay, well it seemed different to me, but it is in the requirement. Thank you, James -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[AngularJS] Two controllers syntax for a custom directive?

2017-08-31 Thread James Drinkard
I have a custom directive that uses a modal dialog ($mdDialog) with a submit button to call some services. All of the code is working, but when it gets minified I get the "Unknown provider: aProvider <- a " error message. After trying to find where this could be in the code, I realized that