Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
/ componitor Public archive

Easy "web component" -like directive generation for AngularJs

License

Notifications You must be signed in to change notification settings

NitorCreations/componitor

Repository files navigation

Componitor Build Status [Dependencies]

Simple html template -like structures to create reusable AngularJS html template directives on-the-fly.

Enables easily creating reusable templates to facilitate DRY principle in AngularJS templates.

Turns this:

<body ng-app="...">
  <labeled-input values="{model: user.username}">
    <label>Username:</label>
  </labeled-input>
    
  <componitor-template name="labeledInput">
    <label>
      <span class="labeled-input-heading">
        <content selector="label" />
      </span>
      <input type="text" ng-model="values.model"/>
    </label>
  </componitor-template>
</body>

into this:

<body ng-app="...">
  <labeled-input>
    <label>
      <span>Username:</span>
      <!-- Points to parent scope's user.username -->
      <input type="text" ng-model="values.model"/> 
    </label>
  </labeled-input>
    ...
</body>

Installation

Bower

bower install componitor

Dependencies

  • angularjs >= 1.2, tested on 1.2.16
  • modern browser or es5-shim

Features

See documentation for usage examples.

License

MIT

About

Easy "web component" -like directive generation for AngularJs

Resources

License

Stars

Watchers

Forks

Packages

No packages published