Question

angular.module('mod1', [])
  .directive('myDir', ($timeout) => {
    return {
      ///....
    }
  });

angular.module('myApp', ['mod1'])
<html ng-app="myApp">

<body>
  <my-dir valu='blablabla' />
</body>

</html>

So why this wouldn't work? and say Unknown provider: $compileProvider,

but if I move directive into myApp module it works

Was it helpful?

Solution

I think it should work fine as long as module dependency has been provided correctly !!

Check this out : http://plnkr.co/edit/Wvb7melvMOgXh3FyoVnx?p=preview

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top