angularjs - Creating pretty URLs for articles with Angular UI Router when articles have an ID -


my app queries api retrieve articles id.

here state configuration:

$stateprovider     .state('article', {         url: "/article/:articleid",         templateurl: 'article.html',         controller: 'articlectrl';         }     }) 

the resulting url retrieving state http://domain.com/article/1234-5678-90

this isn't pretty or memorable url.

is there approach use title of article basis instead of id? (the api call retrieves article includes title property).

usually use slugs, mysite.kom/articles/:id:/:slug: means mysite.kom/articles/28272/my-article-title-is-a-slug

even better put date article:

mysite.kom/articles/2014-04-03/28272/my-article-title-is-a-slug

there no way make long url rememberable, way make seo friendly , maybe short url shortners

this mysite.kom/articles/2014-04-03/28272/my-article-title-is-a-slug

to goo.gl/jnsf837fn

is best can achieve


Comments