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 For example: How do I declare the You use the 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.
& 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) {}; / * ... * /}
scope of the
matrix directive? How can I set these incidents?
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
Post a Comment