var FirstName = ["Mohammad","Alex","Mustafa","Youssef","Ed"];
var LastName = ["Boryani","Jones","Safa","Khansa","Snow"];
var Name=[];
var IDInc = FirstName.length;
for(i=0;i<IDInc;i++)
Name.push(FirstName[i]+" "+LastName[i]);
let app = angular.module('NameRecorder', []);
app.controller('GenTable', ['$scope', '$window',
function($scope, $window)
{
$scope.names = $window.Name;
console.log($window.IDInc);
}
]
);
Hello all, I have this AngularJS code that used to work in HTML.
After I moved it to a js file and used $window, it doesn't work anymore; console.log doesn't print anything not even the Name array.
I tried some javascript commands in he file to make sure the html main page accesses it and it does