1

I don't know why with the following template ng-click doesn't work:

<div>
<md-icon ng-click="console.log('hello'); $event.stopPropagation();" md-font-icon layout-fill ng-
         class="md-raised inline-icon fa statusCellIcon" style="z-index:1000;">
</md-icon>

$event.stopPropagation() executes but not the console.log.

someone knows why?

Thank you.

Tuximo
  • 57
  • 11

2 Answers2

0

Try to add this:

variable $scope.console = window.console;
Leonardo Alves Machado
  • 2,747
  • 10
  • 38
  • 53
0

The solution if someone is interested by was:

Expose the method to the ui-grid by adding the following to the grid options:

appScopeProvider: someFunction: function () { doSomeThing(); }

And in the ColumnTemplate of the grid add the following code:

<div>
<md-icon md-font-icon layout-fill class="inline-icon fa"
         ng-click="grid.appScope.someFunction(); $event.stopPropagation();"
         ng-style="{'cursor':'pointer'}">
</md-icon> ...</div>
Tuximo
  • 57
  • 11