angularjs - Custom events firing -


I have a question that I'm not sure how to apply, but I will try

I have created the custom element, which is called matrix , there are rows and columns in it. I can select a row and / or column. Now I have set the events within my element I am setting fire to: onRowSelect , onColumnSelect , onCellSelect , and passers-to-pass events to any audience I have to.

For example:

  & lt; Matrix data-on-line-select = 'select on-rau' data-on-cell = 'foo' & gt; & Lt; / Matrix & gt; Var Controller = Function ($ scope) {$ scope.onRowSelect = function (a, b, c) {}; $ Scope.foo = function (a, b, c) {}; / * ... * /}   

How do I declare the scope of the matrix directive? How can I set these incidents?

You use the onRowSelect two-way binding in the Director's scope: / P>

 . Directive ('matrix', function () {return {radius: {onRowSelect: '='}, link: function ($ scope) {function onRowSelect () {If (angular.isFunction ($ scope.onRowSelect)) {$ scope .onRowSelect (a, b, c)}}}}}})    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -