I am new at Angular...admitted. Thanks to all so far who have helped along 
the way!

But still lost so maybe I am over / under thinking things. 
So basically I have a back-end API in Laravel 5, and all Angualr request 
hit some end-point for requests as expected.
Back-end has 60+ controllers / 70+ models and enter Angular :)

I am looking at it as a CRUD front-end interface to get data and save 
data....rather basic nothing fancy to this point.

I was pointed to John Papas guide to Angular code structure and I know its 
a style guide, not a tutorial on the building the app, rather how to code 
it but I was struck by his references to getAverngers() or getAvernger() 
and I think why getAvengers()? next week I add StarWars do I re-write the 
exact same functionality to call getStarWars() getStarTrek? 

To me I look at it like getRecord($fromWhereUrl, $id-I-Want) to get 1 
record a or getRecords($url = API + '/starwars') to get all records. To me 
that seems easier. Avengers, StarWars, Apples or Oranges they mean nothing 
other than a record in a database. To me it seems easier to pass a url and 
variable for id to get what you need from a few different functions.....no?

Delete a record why have deleteCharacter(id); and somewhere else have 
deleteApple(id) or over and over performing the same thing? Why is just not 
easier to pass a url where you want to hit on the API?

I do not want to create 60+ angualr controllers / services / directives 
that just do the same thing with just different function names.

What am I missing here?

I know every app has different functionality and such but with 5 or 6 core 
functions could you not handle most of the heavy lifting?

getRecord($url, $id) to pull 1 single record from some where 

getRecords($url) to pull multiple records some where 

putRecord($url, $id) to update a record some where 

postRecord($url) to save a new records some where 

deleteRecord($url, $id)

The backed auth should handle the permissions of who can do what the front 
end should not care? I am using JWT authentication so no matter what the 
front end orders the back determines if your going to get what you ordered.

Most UI / UX "should" follow a similar pattern in response so save / update 
/ delete / fail alerts / exceptions / redirects what not so if each 
function did the same you have a universal look and feel tweak one and its 
a global look your not going thru replacing the functionality all over the 
app.

As I said, new so not trying to be rude, just trying to understand.

I wish there was a real world app, scenario tutorial guide that showed 
multiple controllers, services, directives. Not the typical single app.js 
script all put into 1 file. Something simple like Users, Comments, Posts 
where a new person could see how to work with multiple Angular files and 
how they interact with a back-end.

Thanks again to all :)

Dave

-- 
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 angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to