Is it possible to declare ng-repeat
elements inside of javascript.
I googled try to find the answer but I could not find. If other ways is there please give some ideas I am really lost my way right now.
Thank you
HTML
<div class="" ng-app='app' ng-controller='appCtrl'>
<div ng-repeat='el in names'>
<div ng-click="click">{{el}}</div>
</div>
</div>
JavaScript
var app = angular.module('app', [])
var appCtrl = function ($scope) {
$scope.names = [{
name: 'jane'
}, {
name1: 'jane1',
name2: 'jane2'
}, {
name3: 'jane3'
}];
$scope.click = {
// I want to declare this part
//
//
// if (el.length() == 2) {
// alert('true')
// }
}
}
app.controller('appCtrl', appCtrl())