hexbridge / laravel-elixir-ng-templates

Simple extension to laravel elixir that concatenates and registers AngularJS templates in the $templateCache.
MIT License
1 stars 2 forks source link

mix.ngTemplates is not a function #2

Open djoks opened 8 years ago

djoks commented 8 years ago

When running gulp after integrating your package as instructed I get this error:

TypeError: mix.ngTemplates is not a function

I did everything as you described.

deiucanta commented 8 years ago

@djoks can you make sure the package is actually installed in your node_modules folder? do you get any other errors?

GeorgeKagan commented 8 years ago

Elixir's plugin API has changed

GeorgeKagan commented 8 years ago

This should work for you (this basically replaces the need for the plugin): npm install --save-dev gulp-angular-templatecache

Define the extension in your gulpfile (quick and dirty):

var templateCache = require('gulp-angular-templatecache');
elixir.extend('ngTemplates', function(source, output, options) {
    new elixir.Task('ngTemplates', function() {
        return gulp.src(source)
            .pipe(templateCache(options))
            .pipe(gulp.dest(output));
    }).watch(source).ignore(output);
});

Usage is the same as the plugin discussed.

deiucanta commented 8 years ago

@timenomad can you please send a PR? I will hapily merge it