Gathering detailed insights and metrics for karma-ng-html2js-reqjs-preprocessor
Gathering detailed insights and metrics for karma-ng-html2js-reqjs-preprocessor
Gathering detailed insights and metrics for karma-ng-html2js-reqjs-preprocessor
Gathering detailed insights and metrics for karma-ng-html2js-reqjs-preprocessor
A Karma plugin. Compile AngularJS templates to JavaScript on the fly. Supports RequireJS
npm install karma-ng-html2js-reqjs-preprocessor
Typescript
Module System
NPM Version
CoffeeScript (79.16%)
JavaScript (20.84%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
42 Commits
1 Branches
1 Contributors
Updated on Jun 20, 2014
Latest Version
0.1.0
Package Id
karma-ng-html2js-reqjs-preprocessor@0.1.0
Size
3.96 kB
NPM Version
1.4.16
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
Preprocessor for converting HTML files to AngularJS templates.
Note: If you are looking for a general preprocessor that is not tight to Angular, check out karma-html2js-preprocessor.
The easiest way is to keep karma-ng-html2js-preprocessor
as a devDependency in your package.json
.
1{ 2 "devDependencies": { 3 "karma": "~0.10", 4 "karma-ng-html2js-preprocessor": "~0.1" 5 } 6}
You can simple do it by:
1npm install karma-ng-html2js-preprocessor --save-dev
1// karma.conf.js 2module.exports = function(config) { 3 config.set({ 4 preprocessors: { 5 '**/*.html': ['ng-html2js'] 6 }, 7 8 files: [ 9 '*.js', 10 '*.html', 11 // if you wanna load template files in nested directories, you must use this 12 '**/*.html' 13 ], 14 15 ngHtml2JsPreprocessor: { 16 // strip this from the file path 17 stripPrefix: 'public/', 18 // prepend this to the 19 prependPrefix: 'served/', 20 21 // or define a custom transform function 22 cacheIdFromPath: function(filepath) { 23 return cacheId; 24 }, 25 26 // setting this option will create only a single module that contains templates 27 // from all the files, so you can load them all with module('foo') 28 moduleName: 'foo' 29 } 30 }); 31};
This preprocessor converts HTML files into JS strings and generates Angular modules. These modules, when loaded, puts these HTML files into the $templateCache
and therefore Angular won't try to fetch them from the server.
For instance this template.html
...
1<div>something</div>
... will be served as template.html.js
:
1angular.module('template.html', []).config(function($templateCache) { 2 $templateCache.put('template.html', '<div>something</div>'); 3});
See the ng-directive-testing for a complete example.
For more information on Karma see the homepage.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More