I setup it like this:
postCreate: function() {
var canvas = mxui.dom.div({'style' : 'height: '+ this.height+'px; width: 100%'});
canvas.setAttribute("id",'messagebusdesigner');//set ID
canvas.setAttribute("ng-controller", "busCtrl");
this.domNode.appendChild(canvas);//add as node
var messageBus=document.createElement('div');//create div for message bus
messageBus.setAttribute("message-bus",'');//set attribute message-bus
canvas.appendChild(messageBus);//append to main Div
angular.bootstrap(canvas,['messagebus']);//bootstrap to messagebus module
this.msgbusScope=angular.element(document.getElementById('messagebusdesigner')).scope();//get scope
...
},
Then in applyContext, you can set value to Scope
applyContext: function(context, callback) {
var scope=this.msgbusScope;
scope.$apply(function(){
scope.setValue....;
});
callback && callback();
},