Mayank Dixit | 19 Sep 08:29 2014
Picon

Re: [angular.js] Share data from child to parent controller

change angular external link, choose one from fiddle options and reload. It will work.

On Wednesday, May 16, 2012 10:26:06 AM UTC+5:30, Alexander Wilms wrote:
Sorry, but that does not seem to work.

On Tuesday, May 15, 2012 9:27:31 PM UTC+2, Peter Bacon Darwin wrote:
Try putting a field in the parent scope and then updating that directly in the child scopes.

--
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 angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Oriongu | 19 Sep 07:08 2014
Picon

How to use GetDistanceMatrix with multiples destination

Hello,

I'm struggling to find the best way to use angular with google map api v3.

For info, I'm using the awesome IONIC framework.

What I'm trying to achieve is to pull a list of shops from a restfull api I have running, get the distance from the current user for each and display them in a list ordered by closest

The below code works sort of, but it starts displaying all destinations before each of them have resolved a distance.

Any idea how to make this work a bit more efficiently?

Many Thanks,
Orion



.controller('ShopsCtrl', function(myUser,myService, $scope, $ionicLoading,$rootScope) {

    $rootScope.show('Please wait.. Getting Shops');
    
    myUser
        .getLatLong()                                           
        .then( function( latLong ){
            return myService.getItems( latLong );  
        }).then( function(){
            return myService.findDistance();       
        }).then( function( d ){
            $scope.shops= d;
            $rootScope.hide();
        });
})

.factory('myService', function($rootScope, $http, $q, $cacheFactory,myUser,$ionicLoading) {
            var cache = $cacheFactory('myShops');
return {

getItems: function(latLong) {
                    var shops= cache.get('shops');
                    if (!shops) {
                        return $q.all([
                            $http.jsonp('http://url')
                        ])
                           .then(function(results) {
                               cache.put('shops', results[0].data.posts);
                               return results[0].data.posts;
                            }   
                        );
                    }
                    return bottleshops;
                },
        findDistance: function() {
                    var shops = cache.get('shops');
                    
                    myUser.getLatLong()
                        .then( function( latLong ){
                            
                            angular.forEach(shops, function(shop, key) {
         
                                var origin = new google.maps.LatLng(latLong.lat, latLong.long);
                                var destination = shop.custom_fields.address[0];
                                
                                var service = new google.maps.DistanceMatrixService();
                                service.getDistanceMatrix(
                                {
                                    origins: [origin],
                                    destinations: [destination],
                                    travelMode: google.maps.TravelMode.DRIVING,
                                    avoidHighways: false,
                                    avoidTolls: false
                                }, callback);

                                function callback(response, status) { 
                                    var dist = response.rows[0].elements[0].distance.text;
                                    var order = response.rows[0].elements[0].distance.value;
                                    shops[key].order = order;
                                    shops[key].distanceFromUser = dist;
                                    cache.put('shops', shops);
                                }
                                
                            });
                            
                        }).then( function( shops){
                            return shops; 
                        });
                    
                    return shops;
                }
}
)};


--
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 angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
mcs130 | 18 Sep 22:56 2014
Picon

Eggly tutorial series at egghead.io

There is a terrific series at: https://egghead.io/series/angularjs-app-from-scratch-getting-started  

It jumps right into an HTML5 page and that's all OK, however, it shows the code in an editor and then shows the page running on a web server on localhost:633342.

1) which code editor is being used (is it suggested that one use something like Brackets?) - perhaps Sublime Text? ... either would work, I'm just curious. 
2) is the setup of the web server (and dev environment) covered somewhere prior? 

I really appreciate the work done on these tutorials just want to make sure I'm not missing some pre-requisite steps.


Thanks

--
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 angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
david svee | 18 Sep 21:01 2014
Picon

[AngularJS] AngularJS kompetens, Bra möjligheter.

Hej,

Jag söker just nu AngularJS-kompetens för 

1. - Nytt projekt -
Beskrivning: Ett nytt projekt riktat mot konsumenter. Ideén bygger på ett fungerande koncept med existerande användare idag men kommer i och med detta projekt  innebära stor förändring och mycket större exponering mot flera potentiella kunder. 
Kompetens: AngularJS, Databas, WebAPI, Bootstrap. 
Form: Deltid/Heltid med möjlighet till delaktighet / Konsult

2. - Existerande projekt -
Beskrivning: Sedan en tid tillbaka går vi över från mer klassisk ASP .Net app till AngularJS, WebAPI och MS SQL. Applikationen riktar sig mot Enterpriseföretag och existerande kunder finns.
Kompetens: AngularJS, Databas, WebAPI Bootstrap. (Cloud-erfarenhet meriterande).
Form: Resurs i form av deltidsanställd eller konsult för existerande projekt som behöver extra fart inom närmsta tiden och förmodligen framåt.

Kontakta mig på vid intresse: 
david.svee <at> gmail.com

--
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 angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
umesh nakod | 18 Sep 20:37 2014
Picon

Re: Angular js templates do not call <script> tags. Behavior by design?

after a long time am geeting this problem actually i want to write a 
directive in which template i have to use <script> tag so guys do you get 
any clue about this

please help me..

Christian Nwamba | 18 Sep 18:05 2014
Picon

Keep track of users

Hi!
Is there a way I can keep record of number of users that visit a particulr 
route.
I am using UI route

Christian Nwamba | 18 Sep 18:03 2014
Picon

Double Array

Instead of:
[{"FirstName":"Chris","LastName":"Nwamba","UserID":"7282541d-91e0-4a3c-bf62-31f4cf3ab5fc"}]my Json is wrapped inside another array[[{"FirstName":"Chris","LastName":"Nwamba","UserID":"7282541d-91e0-4a3c-bf62-31f4cf3ab5fc"}]].I cannot iterate throught it when it is like the second, please how do i strip of the second bracket
Thanks

--
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 angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Sander Elias | 18 Sep 17:52 2014
Picon

Re: Can somebody ease my worried mind? I'm trying to avoid too many $http posts to the web server but believe that it's hurting my design

Hi Dan,
 
Yeah, I'm paranoid. In my defense I started on a VIC20, so anything over 4K seems large to me.
You made me chuckle, I remember considering the VIC20, as a replacement for my aging TRS-80.
Went for a NewBrain. (that had a whopping 64Kb! I thought that would last me for a decade at least :-) )

But back to the discussion. Bundling requests is most of the time a good idea. It's a bit more work
on the client, but if your app is going to be run on a high-latency network (mostly mobile) it is a big plus
for your application. It's a lot faster to send a single bundle as opposed to a 10-20 small requests.
That is, while we still are running http1(.1), once all clients/servers have moved to http2(spdy) this
is no longer an issue. but that will probably take at least 3 to 5 years.

Regards
Sander




--
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 angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Re: Can somebody ease my worried mind? I'm trying to avoid too many $http posts to the web server but believe that it's hurting my design

On Thursday, September 18, 2014 8:38:58 AM UTC-7, Dan Rybij wrote:

Yeah, I'm paranoid. In my defense I started on a VIC20, so anything over 4K seems large to me.

Careful Dan...  you're dating yourself a bit... ;-) 

--
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 angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Dan Rybij | 18 Sep 17:02 2014
Picon

Can somebody ease my worried mind? I'm trying to avoid too many $http posts to the web server but believe that it's hurting my design

I'm a bit of old school - I always try to minimize anything that appears 'expensive' and in computer terms, that means avoiding too many operations where I would be waiting for responses from a remote system.

So when I started with using angular, I started a pattern of packaging up multiple requests for data into a single array, POSTing that and in my back-end script I fulfill each request, package up the results and send whole the package back at once. This works great. When my script loads it only sends one POST and expects only one response. I'm not directly using promises.

But I suspect this is an anti-pattern as far as angular is concerned. I'm probably running design limitations.

So, if I lose the packaging mechanism and simply request the data items individually as I need them, cache data appropriately in a model, and start to use promises can you tell me if this is how the app is supposed to be designed? Is this how you do it?

--
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 angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Manu | 18 Sep 16:46 2014
Picon

Angularjs directive

Hi,

I'm new to angularjs, I have one custom directive in which I need to compile angular scope to render scope value (which is dynamic) properly. Can somebody help me? Here is code

<div test="{{ view.test }}" ></div>

.directive('test',function(config, $sc,$compile) {
     return {
                restrict: 'A',
                compile: function(scope, el, attrs) {
                   var test = el.test;
                   el.test = $sce.trustAsHtml(test);
                   el = $compile(el)(scope);
                }
            }

})

I tried using compile but it's not happening and it renders {{test}} in UI.

Thanks in advance

--
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 angular+unsubscribe <at> googlegroups.com.
To post to this group, send email to angular <at> googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Gmane