javascript - Angular Material ng-click not working in custom directive -
i trying use directive create header page html page, since header appear on multiple pages. created directive called 'header' loads header.html
this html uses directive
this directive
app.directive('header', function() { return { controller: headercontroller, templateurl: 'header.html' }; }); header.html
<link rel="stylesheet" href="css/header.css"> <script src="scripts/signin/signin.js"></script> <script src="scripts/signin/signincontroller.js"></script> <md-button class="md-button" id="accountcreation" ng-click="showloginpage()">create account/login</md-button> my header.html file has button should open dialog isn't working. created header using javascript , worked fine. showloginpage defined in controller $scope.showloginpage() function isn't being called upon clicking button
a snippet of controller
app.controller('headercontroller' , function($scope, $mddialog, $mdmedia,userservice) { $scope.status = ' '; $scope.userservice = userservice; var usefullscreen = ($mdmedia('sm') || $mdmedia('xs')) && $scope.customfullscreen; $scope.showloginpage = function() { ... } });
thanks. able figure issue out. adding quotes 1 thing. had create controller in header.html well.
Comments
Post a Comment