Obviously its a long time ago now but I'm curious what approach you took in 
the end to solve this ???

On Wednesday, 30 October 2013 03:06:10 UTC, Chris Thomas wrote:
>
> This topic doesn't necessarily pertain to just Angular, however since I'm 
> using Angular for this project I'd thought I'd post it in here.
> Second note, I am fairly new to angular, so I just be missing something
>
> I am in the process of writing a hypermedia api to manage a catalog / 
> wiki, and using Angular to create the front end for it.
> I have a fairly decent grasp of how the api should be designed, however 
> when creating the client, I can't seem to get around constructing urls.
>
> The landing page is simple enough, it hits the entry point of the api, 
> grabs the items and links that come down and constructs the page.
> This is where I run afoul. 
>
> Imagine the following routes
> app.config(function($routeProvider){
>     $routeProvider.when('/', {
>         controller: 'MainCtrl',
>         templateUrl:  '/partials/root.html'
>     })
>     .when('/items/:itemId', {
>         controller: 'ItemCtrl',
>         templateUrl: '/partials/item.html'
>    });
> );
>
> Say the main controller returns two items:
> [
>     {id: 1, name: "Widget 1", self: "api/widgets/1"},
>     {id: 2, name: "Widget 2", self: "api/widgets/2"}
> ]
>
> From that I create two links that point to /items/1, and /items/2 
> respectfully.
> This is my first issue, dealing with the mapping between the api links and 
> the website links.
>
> The second issue is that when the ItemCtrl is created, the only reference 
> that I have to tell which item is clicked is the :itemId routeParam.
> I could probably cache the object for the link that was clicked and 
> retrieve it through a service injected into ItemCtrl, however that would 
> only work when navigating through the site, and falls apart if they 
> bookmarked #/items/1
>
> Maybe I'm trying to be too much of a purist here, but after using a 
> hypermedia api from a desktop client that didn't support deep linking, I'm 
> hooked on not creating urls manually.
> Anyone have any suggestions or ideas on how to deal with the mapping of 
> html links and api links and supporting deep linking?
>
> 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 [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