json - Angular Route vs $Resource -


so have few rest urls load , bind html when requested. when user searches first name , if first name found html gets populated json. works fine (initial url).

initial url

 var url = http://localhost:8080/usersearch/name/find?firstname='+enteredvalue.firstname+'&lastname=&  $http.get(url).success(function(data){         $scope.dataitems= data;  

now using ng-click on first name want request address , location based on these urls

//urls

 var url = http://localhost:8080/usersearch/addr/find?address=&address   var url = http://localhost:8080/usersearch/loca/find?location=&location 

so started looking ui-router , $resource. first thought use $resource seems if others have had problems ports.

could use router solve problem or should stick resource?

ui-router , $resource different things. ui-router used provide navigation between different states in app while $resource used make calling server side apis more convenient. if need retrieve data restful backend $resource way go. i'm not sure you're referring ports i've built web applications service millions of users daily on top of $resource , not had port problems.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -