Gathering detailed insights and metrics for angular1-templateurl-loader
Gathering detailed insights and metrics for angular1-templateurl-loader
Gathering detailed insights and metrics for angular1-templateurl-loader
Gathering detailed insights and metrics for angular1-templateurl-loader
npm install angular1-templateurl-loader
Typescript
Module System
Node Version
NPM Version
73.3
Supply Chain
95.5
Quality
74.8
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
4 Stars
1 Commits
1 Branches
2 Contributors
Updated on Jul 04, 2019
Latest Version
1.0.0
Package Id
angular1-templateurl-loader@1.0.0
Size
12.89 kB
NPM Version
4.0.1
Node Version
6.10.2
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
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 angular1-templateurl-loader --save-dev
Option 2: Install from yarn.
yarn add angular1-templateurl-loader --dev
Chain the angular1-templateurl-loader
to your currently used TypeScript loader.
1loaders: ['awesome-typescript-loader', 'angular1-templateurl-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 angular1-templateurl-loader
to the awesome-typescript-loader
Will resolve for the template from the resolve.root, in this case the current directory of the file or in the app's root directory
1module: { 2 resolve: { 3 root: [__dirname, './'], 4 extensions: ['', '.ts', '.js', '.json'], 5 }, 6 rules: [ 7 { 8 test: /\.ts$/, 9 use: [ 10 { 11 loader: 'awesome-typescript-loader' 12 }, 13 { 14 loader: 'angular1-templateurl-loader' 15 16 } 17 ] 18 exclude: [/\.(spec|e2e)\.ts$/] 19 }, 20 { 21 test: /\.html$/, 22 use: ['raw-loader'] 23 } 24 ] 25}
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('/myComponent.html" , 3 controller: "MyController" 4});
The angular1-templateurl-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
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/1 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
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
43 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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