angularjs - Deep linking in angular? -
i trying larn deep linking in angular.
as click on link created ng-repeat on exp below:
<ul ng-controller="showordercontroller"> <li ng-repeat="car in cars"><a href="#showorder/cars.indexof(car)"> {{car.brand}}</a> </li> </ul>
it doesn't display relevant detail of clicked link
i understand not linking on controller:
sampleapp.controller('showordercontroller', function($scope, $http, $routeparams) { $http.get('data.json'). success(function(data){ $scope.cars = data; $scope.car_id = $routeparams.carid; }); });
i can't figure out or find source explains plainly how create deep linking..
exp: http://plnkr.co/edit/7d0uegrrtkpxrz8zfxel?p=preview
thanks lot in advance!
try this. working demo
you may alter filter below
<div ng-controller="showordercontroller" ng-repeat="car in cars | filter: { id: car_id } | limitto:1">
angularjs
No comments:
Post a Comment