I was studying angular and wanted to pull the information off the main page, but I'm not able to pull the javascript out.
page repeticao.html:
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script><body><divclass="container" ng-app="myApp" ng-controller="customersCtrl">
<div class="row">
<div class="table-responsive">
<table class="table table-hover">
<tbody id="myTable">
<tr ng-repeat="x in names | filter:test">
<td>{{ x }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("teste.js")
.then(function (response) {$scope.names = response.data.records;});
});
</script>
</body>
</html>
teste.js (to pull this information and play on the main page):
angular.module('myApp', []).controller('namesCtrl', function($scope) {
$scope.names = [
'Jani',
'Carl',
'Margareth',
'Hege',
'Joe',
'Gustav',
'Birgit',
'Mary',
'Kai'
];
});