I am currently learning AngularJS by building a web version of an old Stock picking application I previously published on Android and Windows Phone by the name of Stock Arbiter. The web version will have all the great features and follow the principles taught to me by Phil Town in his Best Selling book “Rule #1″ Disclaimer: I am not affiliated with Phil Town or Rule #1 in any way!. The idea of the application is to do much of the homework of finding a good stock for the end-user. The application will be updated and available on all major mobile platforms soon as well as the web!
Back to the topic of this post, in building the web application, I was in need of a revenue stream and figured Google’s AdSense was a good choice. However, I tried just inserting the Google AdSense code to my main Index page as instructed, however the ads were not coming through. After a little research I became obvious that the AngularJS framework was not processing the calls the Google AdSense API. Turns out I had to make this an AngularJS directive. So I figured I would share the steps to create this AngularJS directive with you: