Gathering detailed insights and metrics for angularjs-template-loader
Gathering detailed insights and metrics for angularjs-template-loader
Gathering detailed insights and metrics for angularjs-template-loader
Gathering detailed insights and metrics for angularjs-template-loader
ngtemplate-loader
Include AngularJS templates in the Webpack bundle and preload the template cache.
ng-component-loader
Webpack loader for AngularJs components
angularjs-templateurl-loader
Webpack loader that inlines all html for AngularJS components/directives.
angular-template-url-loader
AngularJS webpack loader that inlines your templates into angular directives and components.
Webpack loader that inlines all html for AngularJS components/directives.
npm install angularjs-template-loader
Typescript
Module System
Node Version
NPM Version
72.2
Supply Chain
92.1
Quality
75
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
1,080,659
Last Day
236
Last Week
2,851
Last Month
11,090
Last Year
141,233
MIT License
7 Stars
21 Commits
8 Forks
1 Watchers
5 Branches
2 Contributors
Updated on Jul 27, 2024
Minified
Minified + Gzipped
Latest Version
0.1.2
Package Id
angularjs-template-loader@0.1.2
Unpacked Size
7.29 kB
Size
3.31 kB
File Count
6
NPM Version
6.9.0
Node Version
10.16.0
Cumulative downloads
Total Downloads
Last Day
-10.6%
236
Compared to previous day
Last Week
13%
2,851
Compared to previous week
Last Month
-6.2%
11,090
Compared to previous month
Last Year
2.2%
141,233
Compared to previous year
1
Webpack loader that inlines all html for AngularJS code that specifies a templateUrl
. It is a port of code from angular2-template-loader.
Option 1: Install from npm.
npm install angularjs-template-loader --save-dev
Option 2: Install from yarn.
yarn add angularjs-template-loader --dev
Chain the angularjs-template-loader
to your currently used TypeScript loader.
1loaders: ['awesome-typescript-loader', 'angularjs-template-loader'],
To be able to use the template loader you must have a loader registered, which can handle .html
files.
The most recommended loader is
raw-loader
This loader allows you to decouple templates from the component file. This is particularly useful when building complex components that have large templates.
Here is an example markup of the webpack.config.js
, which chains the angularjs-template-loader
to the awesome-typescript-loader
1module: { 2 rules: [ 3 { 4 test: /\.ts$/, 5 use: [ 6 { 7 loader: 'awesome-typescript-loader' 8 }, 9 { 10 loader: 'angularjs-template-loader', 11 options: { 12 relativeTo: path.resolve(__dirname, 'app/src' 13 } 14 } 15 ] 16 exclude: [/\.(spec|e2e)\.ts$/] 17 }, 18 { 19 test: /\.html$/, 20 use: ['raw-loader'] 21 } 22 ] 23}
1angular.module("my-module").component("my-component", { 2 templateUrl: "./myComponent.html" , 3 controller: "MyController" 4});
1angular.module("my-module").component("my-component", { 2 template: require('/root/some/path/app/src/myComponent.html" , 3 controller: "MyController" 4});
The angularjs-template-loader
searches for templateUrl
declarations inside of the AngularJS files and replaces the paths with the corresponding require
statement.
If relativeTo: '/some/absolute/path'
is added to the loader's options, ALL templates will loaded in relation to the specified path instead of the current directory.
The generated require
statements will be handled by the given loader for .html
files.
In some cases the webpack compilation will fail due to unknown require
statements in the source.
This is caused by the way the template loader works.
The Typescript transpiler doesn't have any typings for the
require
method, which was generated by the loader.
We recommend the installation of type defintions, which contain a declaration of the require
method.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/8 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
34 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-04-28
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