I'm having trouble with the button.
When I click on the button with ng-click="goSearchTitle()"
, nothing happens.
Any idea why it's not working?
<body ng-app="myapp">
<div ng-contoller="searchbyTitle">
<h3>Searching by Title</h3>
<div>
<input type="text" id="searchTitle" placeholder="Enter a title" ng-model="searchTitle"/>
<button type="button" id="goSearchTitle" ng-click="goSearchTitle()">Search</button>
</div>
</div>
<script>
angular.module("myapp", []).controller("searchbyTitle", function($scope, $http) {
$scope.goSearchTitle = function(){
alert($scope.searchTitle);
}
});
</script>
</body>