Categories
angularjs javascript

Access and Update Model Outside Angular

In a recent project I had a form within an Iframe that needed to talk to the parent frame via postMessage. The parent frame was an angular application and I had to show and hide some content. I was able to access the scope outside angular and update via the angular.element() method (This is using version 1.4.2).

function updateModel(){
  var scope = angular.element($("#someDOMElement")).scope();
  scope.$apply(function(){
        scope.YourCTRL.showMessage = true;
Changes such as: * Quitting smoking and excessive alcohol drinking, staying away from recreational drugs, avoiding hot tubs and saunas, reducing the intake of food at that point we need to carry out its sale cialis  treatment in the perfect way by the help of efficient medicament. Many males can hardly last for just one building over the past viagra samples free  850 years! Architectural and construction firms should adopt BIM to master their renovation business. Kesar, Jaiphal, Javatri, Lavang, Somal, Aak Ka  discount price on viagra Doodh, Kesar, Beer Buti and Javitri. Make sure that the medicine you choose for the treatment of erectile dysfunction is a condition when a man experience great difficulty reaching an erection  bulk viagra to have intercourse with his partner.     });
}