I am new to angularJS and trying to create a simple application. I have come to an issue when i click on a button, on say, the index.html page, i want to be forwarded to the .search.html page.
Here is my button on index.html:
<body ng-controller="mainController">
<button ng-click="GoToNext2('/search')">Search</button>
</body>
Here is my angular code:
// create the module and name it scotchApp
var scotchApp = angular.module('scotchApp', ['ngRoute']);
// configure our routes
scotchApp.config(function($routeProvider) {
$routeProvider
// route for the home page
.when('/', {
templateUrl : 'home.html',
controller : 'mainController'
})
.when('/search', {
templateUrl : 'Search.html',
controller : 'searchController'
});
});
// create the controller and inject Angular's $scope
scotchApp.controller('searchController', function($scope) {
$location.path(hash);
});
I want to call a function (perform a search when i click too)
Thanks