Giter Club home page Giter Club logo

ng-html2js's People

Contributors

yaru22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ng-html2js's Issues

add option: declareModule: false

the try catch block is ugly. Besides it's possible for the developer to know for sure that the module was already declared at the time of running this script.

Including the templates module prevents beforeEach(inject(...)) from running

Hi, I'm having an issue I don't quite understand while testing my Angular App with Karma + Jasmine.

I've added the following to my karma.conf.js file:

        ngHtml2JsPreprocessor: {
            stripPrefix: 'public/',
            moduleName: 'directiveTemplates'
        },
        preprocessors: {
            'public/js/**/*.html' : ['ng-html2js']
        },

Now as I understand it, this automatically adds all matched html files to the $templateCache.

However the issue I am having is that in the following test file, my inject function does not run.

describe('My ui-router state', function() {

    var state;

    beforeEach(module('myModule'));
    // This causes inject to not run
    beforeEach(module('directiveTemplates'));
    beforeEach(inject(
        function($state) {
            console.log('I log when directiveTemplates is commented out');
            state = $state.get('landing');
    }));

    it('exists', function() {
        // Error: cannot access property name of undefined
        expect(state.name).toBe('landing');
    });

});

add support for multiple files or glob pattern

From what I can tell this only support one file. I could probably invoke the module multiple times but each time I would get the ngModule lookup code. In my projects I have many html files that live close to their respective controllers.

I'll submit a PR if you think this functionality should be added.

Dependency Injection Minified

Could you provide a version where minified source works too?
Your templateCache gets uglified when not using ["templateCache", function($t) {...} ] or something

Is strip-prefix change released ?

I see that strip-prefix was added sometime ago, but I don't see that in the released package. Was it released and I am missing something here ?
I wanted to use that feature.

thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.