{"id":5608594,"date":"2014-12-24T11:18:39","date_gmt":"2014-12-24T11:18:39","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/errors-when-using-angular-in-wordpress-custom-template\/"},"modified":"2016-08-22T13:49:28","modified_gmt":"2016-08-22T13:49:28","slug":"errors-when-using-angular-in-wordpress-custom-template","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/errors-when-using-angular-in-wordpress-custom-template\/","title":{"rendered":"Errors when using angular in wordpress custom template"},"content":{"rendered":"<p>Hi!<\/p>\n<p>I&#8217;m trying to extend the <a href=\"http:\/\/scaffolding.io\/\">scaffolding.io<\/a> theme by including some <a href=\"https:\/\/angularjs.org\/\">angular.js<\/a> code in a custom page template.<\/p>\n<p>I&#8217;ve followed a bunch of blog posts and tutorials and I can use basic angular expressions in my theme. The required libraries are linked and I&#8217;ve wrote my first module and controller, which stablishes the connection with the wp json rest api plugin.<\/p>\n<p>While I use &lt;body ng-app&gt; I&#8217;m able to use angular expressions, but as soon as I change this tag to refer to my module &lt;body ng-app=&#8221;myModule&#8221;&gt;, angular expressions are broken and the console outputs a strange error:<\/p>\n<p><code>Error: [$injector:modulerr] http:\/\/errors.angularjs.org\/1.2.26\/$injector\/modulerr?p0=myModule<\/code><\/p>\n<p>I&#8217;ve changed the libraries linked, the name of my module, the name of the javascript files with my code, the order in enqueuing the scripts to wordpress&#8230; still broken!<\/p>\n<p>Maybe some of you have some idea or experience doing that kind of experiments?<\/p>\n","protected":false},"template":"","class_list":["post-5608594","topic","type-topic","status-closed","hentry","topic-tag-angularjs","topic-tag-custom-page-template"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5608594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5608594\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=5608594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}