Just starting out with AngularJS
We are using REST APIs to access our data
/shop/2/mum
This URL returns JSON which can be bound like so:
function ec2controller($scope, $http){
$http.get("/shop/2/mum")
.success(function(data){
$scope.shopname = data.name;
$scope.location = data.location;
$scope.customer = data.customer;
})
In the HTML:
<div class="shop">
<ul class="list-group">
<li class="list-group-item">
<span class="shop-box">{{showname}}</span>
</li>
<li class="list-group-item">
<span class="shop-box">{{location}]}</span>
</li>
</ul>
</div>
Everything is working smoothly!
Now, we want a dynamic URL format:
/shop/<user-id>/<location>
I need to update this URL when selecting an option from a drop-down, and set the values in {{shopname}}, {{location}} accordingly. Can someone help me with this?
Thank you