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

Busting angular ng-include templates #163

Closed
harshithkashyap opened this issue Oct 18, 2015 · 4 comments
Closed

Busting angular ng-include templates #163

harshithkashyap opened this issue Oct 18, 2015 · 4 comments

Comments

@harshithkashyap
Copy link

I'm trying to bust the angular partials loaded via ng-include using filters. I've tried the following methods but it doesn't seem to work.

HTML

<div ng-include="'/templates/angular/index.html'"></div>

Gruntfile

cacheBust : {
            options : {
                encoding: 'utf8',
                algorithm: 'md5',
                length: 16,
                rename : false,
                filters : {
                    'div' : function(){
                       return this.attirbs['ng-include'].split("'")[1];
                       //return this.attribs['ng-include'].substr(1,this.attribs['ng-include'].length-2);
                    }
                }
            },
            assets : {
                files :[{
                    expand : true,
                    cwd : 'views/',
                    baseDir : 'client/',
                    src : ['index.ejs']
                }]
            }
        },
@nburt
Copy link

nburt commented Dec 30, 2015

@harshithkashyap did you get this working with ng-include templates?

@benhoIIand
Copy link
Owner

I'd recommend taking a look at the feature/v1.0.0-beta branch. There's a lot of changes in there which you can read in #147

@benhoIIand
Copy link
Owner

I've added a test case for this myself in feature/v1.0.0-beta branch and is working fine

@B00TMan
Copy link

B00TMan commented Aug 10, 2018

The path get's revved properly but the resulting string isn't a valid ng-include string value. With backlashes in the ng-include="'the\path\to'" the slashes are just escaping characters at runtime, for the case of ng-include it should replace the path with forward slashes, or double back slashes. Any plan to improve this? or suggestions?

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

No branches or pull requests

4 participants