Giter VIP home page Giter VIP logo

generator-oasp's People

Contributors

jorge-dacal avatar jsanchoh avatar maybeec avatar mmatczak avatar mmatczak-cg avatar robusk avatar tbialecki avatar tomaszglinski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar  avatar  avatar  avatar

generator-oasp's Issues

Problem during installation of generator-oasp

In spite of already installed yeoman, I had a problem by executing
npm install -g generator-oasp

UNMET PEER DEPENDENCY yo@>=1.0.0

I needed to explicitly add "yo" here in order to install the generator:
sudo npm install -g yo generator-oasp

Html templates and browser sync

Hi,

I have faced a problem concerning browser sync and usage of not cached html templates (by cached I refer to the ones converted to .js file with appropriate initialization of $templateCache). When running gulp serve all html files that are asynchronously loaded by angular js are extended by browser sync with a custom script tag. Unfortunately it can lead to some problems. In my case the problem was revealed when adding ui-router to the project. In final step of view switching it runs:

$element.html(locals.$template ? locals.$template : initial);

In current project configuration jQuery is plugged in and as a result its implementation of .html is being called. jQuery is so smart that it copies all scripts and then run global eval on them:

if ( hasScripts ) {
    doc = scripts[ scripts.length - 1 ].ownerDocument;
    // Reenable scripts
    jQuery.map( scripts, restoreScript );
   // Evaluate executable scripts on first document insertion
   for ( i = 0; i < hasScripts; i++ ) {
       node = scripts[ i ];
       if ( rscriptType.test( node.type || "" ) && !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
            if ( node.src ) {
     ...
           } else {
                 jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
           }
      }
   }
}

For us it means that script attached by browser sync will run, what causes the whole view to be cleared (I did not check if the same occurs in case of using jqLite).

If we want to provide a flexible and stable development environment it should not cause such exceptions/problems.

Imho html files should not be watched anyway, because if developer has already entered the view, then the template was loaded and cached in $templateCache. Browser sync is able to inform the browser to refresh resources, but not to inform angular to refresh its cache. In case of generated cached templates everything seems to be fine - run method will be executed on the reloaded module so entries in $templateCache will be replaced.

Cheers,
Bartek

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.