@angularclass/conventions-loader

WebJar for @angularclass/conventions-loader

License

License

Categories

Categories

Angular User Interface Web Frameworks
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

angularclass__conventions-loader
Last Version

Last Version

1.0.13
Release Date

Release Date

Type

Type

jar
Description

Description

@angularclass/conventions-loader
WebJar for @angularclass/conventions-loader
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/angularclass/angular2-conventions-loader

Download angularclass__conventions-loader

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/angularclass__conventions-loader/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>angularclass__conventions-loader</artifactId>
    <version>1.0.13</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/angularclass__conventions-loader/
implementation 'org.webjars.npm:angularclass__conventions-loader:1.0.13'
// https://jarcasting.com/artifacts/org.webjars.npm/angularclass__conventions-loader/
implementation ("org.webjars.npm:angularclass__conventions-loader:1.0.13")
'org.webjars.npm:angularclass__conventions-loader:jar:1.0.13'
<dependency org="org.webjars.npm" name="angularclass__conventions-loader" rev="1.0.13">
  <artifact name="angularclass__conventions-loader" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='angularclass__conventions-loader', version='1.0.13')
)
libraryDependencies += "org.webjars.npm" % "angularclass__conventions-loader" % "1.0.13"
[org.webjars.npm/angularclass__conventions-loader "1.0.13"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : loader-utils jar [0.2.15,0.3)

Project Modules

There are no modules declared in this project.

Angular 2 Fundamentals


Angular 2 Conventions Loader

Allow defaults for @Component metadata for Angular 2

npm install @angularclass/conventions-loader --save-dev loader options

// default values
selectorPrefix = '';
cssExtension   = '.css';
htmlExtension  = '.html';
'-component' is removed from selector generated by className
{
  test: /\.ts$/,
  loaders: [
    'ts-loader',
    '@angularclass/conventions-loader'
  ]
},

Given this simple Component example app.js

@Component({})
export class App {
}

Webpack will change the code app.js

@Component({
  selector: "app",
  styles: [require("./app.css")],
  template: require("./app.html")
})
export class App {
}

this is assuming you have corresponding files next to the component. You may overwrite the selector at anytime by providing one. If the selector and the component file name does not match then the corresponding css/template file with the selector will be injected.

Credits

Sean Larkin from the Webpack team TheLarkInn/angular2-template-loader


enjoy — AngularClass



AngularClass ##AngularClass

Learn AngularJS, Angular 2, and Modern Web Development from the best. Looking for corporate Angular training, want to host us, or Angular consulting? [email protected]


Apache-2.0

org.webjars.npm

AngularClass

Learn Angular and Modern Web Development. [No longer in operation]]

Versions

Version
1.0.13
1.0.2