angularjs - ocLazyLoad - one controller calling another -


in header.html have 2 controllers, header controller , language controller.

this headerctrl:

define( [     'angular', 'layout/layout.module','languages/languages.module',         'languages/controllers/languagesctrl' ], function (angular) { 'use strict';  angular.module('app.layout').controller('headerctrl', headerctrl);  /* @nginject */ function headerctrl() {     var header = this;     header.pagetitle = 'response coming headerctrl'; } 

});

my state: (via svc call json file)

 "header": {               "templateurl": "app/layout/views/tpl.header.html",               "controller": "headerctrl header",               "resolve": {},               "data": {                 "modulename": "app.layout",                 "modulefiles": [                   "app/languages/controllers/headerctrl.js"                 ]               } 

question:

how can pass scope languagesctrl headercontroller html has both headerctrl & languagesctrl scope, without requiring click event? [because of headercontroller's defines, languagecontroller loading, cannot communicate it.]

i have solution caveat:

if go github angularjs-requirejs-lazy-controllers, there mblazycontroller directive job.

the caveat:

as near can tell / have tried, cannot have "controller as" scenario have use $scope:

  <div mb-lazy-controller="languages/controllers/languagesctrl">   {{message}}        </div> 

but job , works angularjs 1.3.2.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -