AngularJS. Best practice structuring blog posts in JSON -


Now I have 2 JSON files that are responsible for the content of the article. The articles are used to keep "short authors": "abbreviated name", "stenographer": "short name is here," "maybe a little bit longer", "images": ["img / article-img 1.jpg" ], "Features_State": True, "FECHS_IMG": ["IMG / Featured-IMG-1. JPG"]}]

Then I Based on this, I use the following construction to get article details for the particular article:

  app.controller ('ArticleCtrl', ['$ scope', '$ path perm' '$ Http', function ($ radius, $ path page, $ http) {$ http.get ('page / article /' + $ routeParams.articleId + '.json') .vivet (data) {$ Scope .article = data;});}]);  

1.json article file looks like this

  {"id": "1", "category": "books and magazines", " Title ":" Heading Here "," html_desc ":" & lt; p> Article Content Here  "," Image ": [" img / featured-img-1.jpg "]  

}

So if the URL / article / 1, then this article looks for the 1.json file from the folder. Now I think it would be better to add these JSO files in one and keep information about all the articles in one place. Is it a good idea and in order to load this code based on URL, to check which article, how to make this large JSON? I will have approximately 30 articles

And on the one hand, is there any new articles in this JSON to edit or add?


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -