Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken image inside directive #468

Closed
9mm opened this issue Aug 21, 2014 · 4 comments
Closed

Broken image inside directive #468

9mm opened this issue Aug 21, 2014 · 4 comments

Comments

@9mm
Copy link

9mm commented Aug 21, 2014

Hello,

I'm using an image source dynamically inside a directive. It works fine with grunt serve, but breaks under grunt serve:dist. Is there an extra step I need to do? Sorry if this isn't the right place to put this, I'm not sure the best place to ask.

Thanks!

app.directive('summary', function() {
  var summaryTemplate = 
    '<div id="summary">' +
      '<h1><img ng-src="/assets/images/sidebar/{{icon}}.png" alt="icon">{{title}}</h1>' +
      '<div ng-show="active" ng-transclude class="summary-content"></div>' +
    '</div>';
    // ... more code ...
@DaftMonk
Copy link
Member

Thats probably breaking because the rev task is renaming images for caching purposes, and it's not recognizing that as an image because the angular expression.

You can ignore specific folders and images by adding a negative file list to the end of the rev tasks list of files:

        '!<%= yeoman.dist %>/public/assets/images/sidebar/*'

@9mm
Copy link
Author

9mm commented Aug 21, 2014

Is it possible I can do the inverse, and add some kind of setting to useminPrepare to get it to recognize angular directives? (just so it's consistent I guess)

@9mm
Copy link
Author

9mm commented Aug 21, 2014

Nevermind... I guess I will just use a class and move it to CSS.

@9mm 9mm closed this as completed Aug 21, 2014
@kingcody
Copy link
Member

@9mm, I've found that to be the easiest solution as well. Also moving the template to an html(type) file works to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants