{"action":"opened","issue":{"url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/258","labels_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/258/labels{/name}","comments_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/258/comments","events_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/258/events","html_url":"https://github.com/ocombe/ocLazyLoad/issues/258","id":113218418,"number":258,"title":"Dependency of $templateCache not resolved correctly in .run of a dependency","user":{"login":"iJungleboy","id":5321186,"avatar_url":"https://avatars.githubusercontent.com/u/5321186?v=3","gravatar_id":"","url":"https://api.github.com/users/iJungleboy","html_url":"https://github.com/iJungleboy","followers_url":"https://api.github.com/users/iJungleboy/followers","following_url":"https://api.github.com/users/iJungleboy/following{/other_user}","gists_url":"https://api.github.com/users/iJungleboy/gists{/gist_id}","starred_url":"https://api.github.com/users/iJungleboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iJungleboy/subscriptions","organizations_url":"https://api.github.com/users/iJungleboy/orgs","repos_url":"https://api.github.com/users/iJungleboy/repos","events_url":"https://api.github.com/users/iJungleboy/events{/privacy}","received_events_url":"https://api.github.com/users/iJungleboy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-25T10:38:42Z","updated_at":"2015-10-25T10:38:42Z","closed_at":null,"body":"Here's the scenario: i'm using Angular Formly and based on the form configuration sometimes it has to download additional custom field-UIs. each field UI is a separate module which uses this kind of setup...\r\n\r\n    angular.module(\"ToSicEavCustomGps\", []) \r\n        .config(function(formlyConfigProvider, defaultFieldWrappers) {\r\n\r\n            formlyConfigProvider.setType({\r\n                name: \"custom-gps\",\r\n                templateUrl: \"fields/custom-gps/custom-gps.html\",\r\n                wrapper: defaultFieldWrappers,\r\n                controller: \"FieldTemplate-CustomGpsController\"\r\n            });\r\n        })\r\n\r\nthe templates are in HTML files which get placed in the $templateCache by a grunt process angular-templates - resulting in this code being loaded in the same file as the previous angular-module:\r\n\r\n```\r\nangular.module('tempCustomGpsTmplates',[]).run(['$templateCache', function($templateCache) {\r\n  'use strict';\r\n\r\n  $templateCache.put('fields/custom-gps/custom-gps.html',\r\n    \"<div><div class=\\\"alert alert-danger\\\">GPS-Picker 2 - not implemented yet <input class=\\\"form-control input-lg\\\" ng-pattern=vm.regexPattern ng-model=value.Value></div><div ng-if=debug.on><h4>debug info</h4><div>lat field name: '{{ latField}}' long-field name: '{{longField}}'</div></div></div>\"\r\n  );\r\n\r\n}]);\r\n```\r\n\r\nthis throws an error atht $templateCacheProvider is missing.\r\n\r\nalternately if I place the code in a service (manually, because the grunt-job won't do this) it works: \r\n\r\n```\r\n    // tests w/template cache\r\n    .service(\"addtemplatestocache\", //)\r\n        function ($templateCache) {\r\n        $templateCache.put('fields/custom-gps/custom-gps.html',\r\n          \"<div><div class=\\\"alert alert-danger\\\">GPS-Picker 2 - not implemented yet <input class=\\\"form-control input-lg\\\" ng-pattern=vm.regexPattern ng-model=value.Value></div><div ng-if=debug.on><h4>debug info</h4><div>lat field name: '{{ latField}}' long-field name: '{{longField}}'</div></div></div>\"\r\n        );\r\n\r\n    })\r\n```\r\n\r\nso apparently $templateCache is resolved properly in a service call, but not in the run. Is this a bug or am I missing something?"}}