I made a route in my app, and I want to show alert when click button in template :
please help me:
this is my JavaScript:
var trainingApp = angular.module('training', ['daypilot','ngRoute']);
angular.module('training')
.config(function($routeProvider){
$routeProvider
.when('/',{
templateUrl: 'index.html',
controller: 'mainCtrl'
})
.when('/login',{
templateUrl: 'login.html',
controller: 'profilecontroller'
})
})
.controller('profilecontroller',['$scope', function($scope){
$scope.alertt = function(){
alert("okkkkkkk");
}
}])
.controller('mainCtrl', .........
<button ng-click="alertt()">ok</button>