That should be two separate functions, not one giant function.

//this function changes your path and route
$scope.editContact = function(contactID) {
    $location.path('/contact/' + contactID);
};

//this function that you should run if $routeParams.contactID is not 
undefined
$scope.getContactDetails = function(){
     //do your retrieval here, using $routeParams.contactID as where to get 
the contact ID
};

I'll be the first to admit that the docs on this section leave a lot to the 
imagination, but it isn't really that hard. There are a TON of examples out 
there. Google is your friend...

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to