oasp / generator-oasp Goto Github PK
View Code? Open in Web Editor NEWYeoman Genarator for AngularJS applications powered by OASP4JS
License: Apache License 2.0
Yeoman Genarator for AngularJS applications powered by OASP4JS
License: Apache License 2.0
npm installation doesn't include oasp-base-generator.js
file which leads to errors when using sub-generators. Placing the file manually fixes the problem.
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
Please Use karma direct instead of deprecated gulp-karma.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.