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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -