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).


Using Pathmodify a Browserify plugin with Gulp

To better understand what we are going to solve in this post take a look at what Pathmodify does.


Notice lines 8-11 which is where the pathmodify plugin is used. On lines 9-10 is where we will alias a directory. We will take line 10 as an example from here on. The method .dir in pathmodify.mod.dir() takes two arguments. The first is the name of the alias in this case it’s “ng_services”, and this can be anything you want. The second argument is the absolute system path where your in this case angular services reside.


Now, in our app.js file we can use these new alias within our require() methods.  Take a look at all the require methods and notice how the alias are used.  So, now instated of using something along the lines of ../../../../../ you can just use the alias.

Using $http and $q in an Angular Service

JS Bin on

© 2018 Aldomatic

Theme by Anders NorenUp ↑