0

I am new to angular-kendo.js. I want to call a function emailClick() from href ie.

<a href="javascript:void(0);" k-on-click = "emailClick()">Email</a>

and my controller and route is as follows :

app.controller('ContactCtrl', ['$rootScope', '$scope', 'appSvc',
 function($scope, $rootScope, appSvc) {
    $scope.emailClick = function() {
        appSvc.selectItem = 'email';
        appSvc.back = true;
        $rootScope.go('email', 'slideLeft');
    };
 }]);

app.config(['$routeProvider',
        function($routeProvider) {
            $routeProvider.when('/', {
                templateUrl : 'partials/home.html',
                controller : 'HomeCtrl'
            }).when('/email', {
                templateUrl : 'partials/email.html',
                controller : 'ContactCtrl'
            }).otherwise({
                templateUrl : 'partials/home.html',
                controller : 'HomeCtrl'
            });
        }]);
    }());

Now on clicking Email I should go to the function emailClick() but it is not happpening. there is no error and no response. Please help.

Thanks in advance.

Anindya
  • 41
  • 1
  • 13

1 Answers1

0

you need to use ng-click directive,

 <a href="javascript:void(0);" ng-click = "emailClick()">Email</a>
Jayantha Lal Sirisena
  • 21,216
  • 11
  • 71
  • 92
  • ok thank you it finally worked with the above technique. The mistake I did was that I mentioned `emailClick()` function in different controller. – Anindya Jun 19 '14 at 10:37