🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

dinline

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dinline

browserify angularjs directives

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Directive Inline

This module is a plugin for browserify. It looks for angularjs directives in AST, and inlines static template files into directive declaration.

build status

Example - helloWorld directive

Our custom directive template helloWorld.html:

<h1>Hello world</h1>

Directive export in helloWorld.js:

module.exports = function () {
  return {
    templateUrl: './helloWorld.html'
  };
};

After running on the command line:

browserify -t dinline helloWorld.js > bundle.js

Our directive definition changes from

  // ...
  return {
    templateUrl: './helloWorld.html'
  };

to

  // ...
  return {
    template: "<h1>Hello world</h1>\n"
  };

Note: This transform module implements very simple use case, when directive is declared in a form of return statement with explicit literal path assignment to templateUrl property. Please let me know if your use case is more sophisticated than this.

License

BSD 2-clause

Keywords

browserify

FAQs

Package last updated on 07 Dec 2013

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