angularjs - Angular ng-click onsen -
so im new coding , cant seem figure out issue have.
<ons-row ng-click="mynavigator.pushpage('{{building.file}}.html')">
so started , {{ building.file }} isn't going url. can me or explain why isnt workking? here complete code
<div ng-init="buildings = [ {name:'name1',file:'file1', location:'location1', image:'images/img1.jpg', number:'(123) 400-0000'}, {name:'name2',file:'file2', location:'location2', image:'images/img2.jpg', number:'(123) 400-0000'}, {name:'name3',file:'file3', location:'location3', image:'images/img3.jpg', number:'(123) 400-0000'}, ]"> <!--there {{buildings.length}} restaurants--> <input type="search" ng-model="q" class="search-input" placeholder="search..." /> <br /> <ons-list > <ons-list-item modifier="chevron" class="list-item-container" ng-repeat="building in buildings | filter:q results"> <ons-row ng-click="mynavigator.pushpage('/' + {{building.file}} + '.html')"> <ons-col width="95px"> <img src="{{building.image}}" class="thumbnail"> </ons-col> <ons-col> <div class="name"> {{building.name}} </div> <div class="location"> <i class="fa fa-map-marker"></i> {{building.location}} </div> <div class="desc"> {{building.number}} </div> </ons-col> <ons-col width="40px"></ons-col> </ons-row> </ons-list-item> </ons-list> <ul class="example-animate-container"> <li class="animate-repeat" ng-if="results.length == 0"> <strong>no results found...</strong> </li> <li class="animate-repeat" ng-if="results.length == 555"> <strong>no results found...</strong> </li> </ul>
i don't have exact code think u should not use expression within function call. created sample demonstration app demo. please check on console clicking on name. logs correct url. hope helps!
<div ng-click="pushpage('/' + building.file + '.html')"> {{building.name}} </div>
Comments
Post a Comment