js i have this...
controller: "photogridCtrl",
templateUrl: 'js/ng-assets/templates/directives/photogrid-view.html',
scope: '=info'
in my controller i have 2.
$scope.home = [
{
img: 'img/burlington.jpg',
label: 'Burlington',
action: '#/',
row:'col-md-12',
class:''
}
and the other one is...
$scope.featured = [
{
img: 'img/kitchener.jpg',
label: 'Kitchener',
action: '#/',
row:'col-md-12',
class:''
}
in my view...
<div class="photo-grids">
<div class="row">
<div class='{{item.row}} margin-bottom' ng-repeat='item in home'>
<a href="{{item.action}}" class="photo-item {{item.class}}" style="background-image:url({{item.img}});">
<span class="photo-caption"><h4>{{item.label}}
<br><small>Ontario</small></h4></span>
</a>
</div>
</div>
and in my main index i have 2 party of the page where i want to display the photogrid-view.html
<photogrid-view></photogrid-view>
<photogrid-view info='featured'></photogrid-view>
Now as you can see in my ng-repeat i have "item in home"
I just want to ask how I can change home
to something that will change depending on the variable in <photogrid-view info='featured'></photogrid-view
so if it is featured it will output the values from $scope.featured
and if the info=home then it will output the values from $scope.home
. So it would be like...
If info=='home' then ng-repeat="item in home"
else if info==''featured then ng-repeat="item in featured"
sorry for the long explanation. But thanks! :)