Giter VIP home page Giter VIP logo

Comments (4)

SimonCropp avatar SimonCropp commented on July 1, 2024

there is a constructor that takes in a JS engine. so you can add any scripts you want before a render
https://github.com/SimonCropp/Chevron/blob/master/Chevron.IE/Handlebars.cs#L16

Also all member are virtual so you should be able to change the behaviour of any of them.

So i am not sure what you "cant do".

Perhaps you could show me in a pull request?

from chevron.

yannisgu avatar yannisgu commented on July 1, 2024

What I would like to achive is to run scripts after handlebars is loaded, but before anything is rendered.

To enable this Handlerbars.cs needs a public property Engine or a method ExecuteScript(string script)

from chevron.

SimonCropp avatar SimonCropp commented on July 1, 2024

The handlebars is loaded in the constructor. So why cant you do this

var msieJsEngine = new MsieJsEngine(JsEngineMode.Auto);
    using (var handleBars = new Handlebars(msieJsEngine))
    {
        msieJsEngine.Execute("my Js to run before rendering");
        handleBars.RegisterTemplate("Index", source);
        Approvals.Verify(handleBars.Transform("Index", null));
    }

from chevron.

yannisgu avatar yannisgu commented on July 1, 2024

Ohh, yeah, of course!

from chevron.

Related Issues (20)

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.