Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

ng-click not working with md-button unless function is attached to $scope #5990

@Marabyte

Description

@Marabyte

When binding an object directly to a controller ng-click doesn't work with ng-button ie:

app.controller('ConfigCtrl', function () {
  var config = this;   
  config.nextTab = function (){
    console.log('Doesn't work');
  };
});
<md-button class="md-raised md-cornered md-primary" ng-click="config.nextTab()">Next</md-button>

But this works :

app.controller('ConfigCtrl', function ($scope) {
  $scope.nextTab = function (){
    console.log('Doesn't work');
  };
});
<md-button class="md-raised md-cornered md-primary" ng-click="nextTab()">Next</md-button>

Am I missing something obvious?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions