0

I am studying angular js and I think its a simple question

See script - Its repeating tag ( ng-repeat )

<a href="#/modelList/{{carBrandList.data[5].model}}">{{brand.model}} </a>

You note this {{carBrandList.data[5].model}} In that tags

my Question

I want to be set array value correspond repeating row - {{carBrandList.data[dynamic correspond value].model}}

my failure code

<a href="#/modelList/{{carBrandList.data[`{{$index + 1}}`].model}}">{{brand.model}} </a>

controller

angular.module('carPricesApp.controllers',[]).
controller('carPricesController', function($scope, $http){

    $scope.carBrandList = [];
    $http.get("apidata.js")
      .success(function(response) {
        $scope.carBrandList = response
      }) 
})
1

1 Answer 1

1

Try this in ng-repeat

<a href="#/modelList/{{carBrandList.data[$index + 1].model}}">{{brand.model}} </a>
Sign up to request clarification or add additional context in comments.

2 Comments

your welcome buddy.. yeah its easy to learn :) start with a small project.. Try this docs.angularjs.org/tutorial
Thanks :) May i ask your skype id

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.