Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@angularclass/conventions-loader

Package Overview
Dependencies
Maintainers
4
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angularclass/conventions-loader

Allow default for @Component metadata for Angular 2

  • 1.0.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

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? patrick@angularclass.com


Apache-2.0

Keywords

FAQs

Package last updated on 07 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc