I have a basic AngularJS controller that I am working on, and I would like it to include two separate functions:
var app = angular.module('searchApp', []);
app.controller('searchCtrl', function($scope, $http, $log) {
//Function 1
$scope.search = function() {
$http.post('server.php', { "data" : $scope.keywords})
.success(function(data, status) {
$scope.result = data;
})
};
//Function 2
$scope.tableClick = function() {
$log.log('Hello World!');
};
})
I seem to be encountering a syntax issue because the script only works when I remove the second function.
When I try running the script with both functions included (as shown above), I am seeing {{ x }} for the content of the following HTML elements:
<tr ng-repeat="x in result">
<td><a href="www.test.com" >{{ x }}</a></td>
Any ideas on what could be causing this?