0

I want to implement Angular widgets similar to KendoUI. In kendo we implement the widgets by Angular directives as follows

HTML

    <input kendo-numerictextbox k-min=1 k-max=5 k-on-spin="valueChanged(kendoEvent)">

k-min -> this can be implemented by reading the Attrs in the directives and modifying the Element

k-on-spin ->whenever value is changed we call this valueChanged() function which can then be implemented in the end users Angular controller as follows

$scope.valueChanged = function(e){
console.log(e.event.target.tagName)};

Question: how to implement the k-on-spin in Angular directive, so that if user wants they can hook up their function when this event occurs.

Gaurav_soni
  • 6,064
  • 8
  • 32
  • 49
  • possible duplicate of [Call an AngularJS Controller Function from a directive without isolated scope](http://stackoverflow.com/questions/17583004/call-an-angularjs-controller-function-from-a-directive-without-isolated-scope) – Bricktop Mar 02 '15 at 18:42

1 Answers1

0

You should use $eval or $apply to get AngularJS to evaluate your function.

You can read more about$apply here.

There has already been a question dealing with this problem and a good answer here.

Community
  • 1
  • 1
Bricktop
  • 1,549
  • 14
  • 23