Can I declare ng-repeat elements inside of javascript

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


<div class="" ng-app='app' ng-controller='appCtrl'>
    <div ng-repeat='el in names'>
        <div ng-class="class">{{}}</div>


var app = angular.module('app', [])
var appCtrl = function ($scope) {
    $scope.names = [{
        name: 'jane'
    }, {
        name: 'jane1',
        name: 'jane2'
    }, {
        name: 'jane3'
    $scope.class = {
        // I want to declare this part 
        // if (el.length() == 2) {
        //     alert('true')
        // }

app.controller('appCtrl', appCtrl())


Source: javascript

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.