yeoman / generator-angular

Yeoman generator for AngularJS
http://yeoman.io
5.73k stars 1.44k forks source link

Grunt build does not properly attaches directive templateUrl #1383

Open TiwariShubham opened 7 years ago

TiwariShubham commented 7 years ago

I have templateUrl in my directives and it is put up in the template folder just like there are views kept inside views folder but when I run grunt build, it somehow misses to take care of the templateUrl mentioned in the directives. If anyone has got any solution to it, then please let me know. Thanks!

himanshuchandra commented 7 years ago

This issue is a same as https://github.com/yeoman/generator-angular/issues/1380 the solution provided worked fine for me.

TiwariShubham commented 7 years ago

Did downgrading worked for you?

himanshuchandra commented 7 years ago

It's a problem with angular 1.6 but before downgrading I tried this

angular
  .module('webApp', ['ngAnimate', 'ngAria', 'ngCookies', 'ngMessages', 'ngResource', 'ngRoute', 'ngSanitize', 'ngTouch'])
  .config(function ($routeProvider, $locationProvider) {
    $routeProvider
      .when('/blog', {
        templateUrl: 'views/blog.html',
        controller: 'BlogCtrl',
        controllerAs: 'blog'
      })
      .otherwise({
        redirectTo: '/'
      });

     $locationProvider.hashPrefix('');
  });

given by Playntek in #1380 and it worked fine,so no need to downgrade.