javascript - controller from another module not working -
hey having problem trying child controller working. have created 2 modules in total. 1 handling directives , controllers them , handle gmail side of things.
//js file 1 var gmailmod = angular.module('gmailmod', []); gmailmod.controller('gmailctrl',function gmailctrl(gmailfactory){ this.authorize = function(){ console.log("clicking"); //gmailfactory.gmailauthorize(); } }); //jsfile2 var emailmodule = angular.module('emailmod', ['ui.bootstrap']);
i have third file called config declares dependencies
angular.module('seamysapp', ['ngroute', 'emailmod', 'gmailmod'])
so anyways email mod works when try declare child controller on button form gmailmod
<div ng-controller="gmailctrl"> <button ng-click="authorize()" class="btn-info" >not authorized yet! click here! :)</button> </div>
nothing works. can't authorize function work. why happening know? i'm getting no errors in console think must logical error me , it's difficult find. in advance help.
<div ng-controller="gmailctrl gctrl"> <button ng-click="gctrl.authorize()" class="btn-info" >not authorized yet! click here! :)</button> </div>
Comments
Post a Comment