I can't for the life of me figure out why I can't call this function in my controller.
On clicking an accordion-group attribute I get this error:
Uncaught ReferenceError: getConversationsForUser is not defined
Here is the html:
<ui-view id="smtConvoCard" layout="column" layout-fill layout-padding>
<div layout="row" flex layout-align="center center">
<md-card flex-gt-sm="90" onresize="resize()" flex-gt-md="80">
<md-card-content>
<md-list>
<h2>Conversations</h2>
<accordion close-others="oneAtATime">
<accordion-group heading="{{contact.FirstName}} {{contact.LastName}}" ng-repeat="contact in contacts" onclick="getConversationsForUser(contact.UserUID)">
<div>Test</div>
</accordion-group>
</accordion>
</md-list>
</md-card-content>
</md-card>
</div>
</ui-view>
Here is the controller being used (partial code):
controller('convCtrl', ['$scope', 'messageFactory', function ($scope, messageFactory) {
var currentUser = helpers.storage.get('UID');
$scope.contacts = [];
$scope.getContacts = function () {
/*Does stuff*/
};
//This is the function it is trying to call
$scope.getConversationsForUser = function (userUID) {
/*Does stuff*/
};
//Setup
$scope.getContacts();
}]);
I've tried changing the onclick even to a different element, calling the getContacts function instead and I always get Uncaught ReferenceError
I know that function is within my scope because I'm data binding the contacts variable to the page.
ng-click