These are chat archives for tfoxy/bs-injular

13th
Jun 2017
Tomás Fox
@tfoxy
Jun 13 2017 02:29
I published a new version. It should be fixed now. I split the client and server code of the repo, so you must run npm install --save-dev bs-injular injular@legacy . I also added the fixes of your branch.
RichardFans
@RichardFans
Jun 13 2017 03:36
thanks @tfoxy , i use browser-sync 2.9.12 it works. but still have a little problem:
RichardFans
@RichardFans
Jun 13 2017 03:47

for directive templates, example:

angular.module('c.d')
    .directive('footer', function () {
        return {
            templateUrl: 'templates/cache/footer.html',
            restrict: 'E',
            replace: true
        }
    });

when i use replace: true, the console will print something like:

Template for directive 'footer' must have exactly one root element.

i think that because bs-injular inject some statements around my template:

<!--bs-injular-start /templates/dp_no_clear_btn.html-->
<div class="col-xs-12 footer">
    ... ...
</div>
<!--bs-injular-end /templates/dp_no_clear_btn.html-->

to my custom directive, i can just change 'replace' to 'false', but if i use some third part package like datepicker-popup-template-url, i could not find out how to fix it. Many thanks.

RichardFans
@RichardFans
Jun 13 2017 04:04
or can i exclude some template files in config like:
browserSync.use(bsInjular, {
    templates: ['/+(views|templates)/**/*.html', '!templates/dp_no_clear_btn.html'],
    controllers: ['/scripts/controllers/**/*.js', '/**/*.ctrl.js'],
    directives: '/scripts/directives/**/*.js',
    filters: '/scripts/filters/**/*.js',
    angularFile: '/bower_components/angular/angular.js',
    moduleFile: '/scripts/module.js',
    ngApp: 'c'
});