Gordon, it worked! :)

On Thursday, April 17, 2014 11:17:09 PM UTC-5, Gordon Bockus wrote:
>
> resolve is a ui-router thing. You should be using the $stateParams to pull 
> the projectId off the url.
>   resolve: {
>                 project: function(Restangular, $stateParams){
>                     return Restangular.one('projects', 
> $stateParams.projectId).get();
>                 }
>
> Gordon
>
> On Thursday, April 17, 2014 10:51:58 PM UTC-5, Neil Camara wrote:
>>
>> Good evening folks. I recently added Restangular. I used the code from 
>> the live demo and I inserted it into my code. It's working. However, for 
>> the /edit link, it was failing to call the link until I commented out the 
>> resolve. Right now the code below is what makes it work.
>>
>>         .state("main.edit", {
>>             url: "/edit/:projectId",
>>             controller: EditCtrl,
>>             templateUrl: 'views/detail.html'
>> //            resolve: {
>> //                project: function(Restangular, $route){
>> //                    return Restangular.one('projects', 
>> $route.current.params.projectId).get();
>> //                }
>> //            }
>>         })
>>
>>
>> Is resolve an ngRoute thing? If so, what is the proper way to code the 
>> above so that it doesn't fail?
>>
>> Thanks,
>>
>> Neil
>>
>

-- 
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/d/optout.

Reply via email to