This package has been deprecated

Author message:

No longer maintained. Use data- tags in html to accomplish similar behavior

@zthun/identifier.angularjs
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Description

This package is the dynamic id generator for AngularJS.

See @zthun/identifier.core for the general problem and solution that this package attempts to solve.

WARNING: This will be the last major.minor version published for @zthun/identifier.angularjs. The only remaing patches that will be published will be for the case of one of the following criteria.

  • A bug is found in the current production release of @zthun/identifier.angularjs that is critical and there is no workaround.
  • A release of angular 1.7.x that will cause the current production version of @zthun/identifier.angularjs to stop working.

How to Use

Install the package from npm into your project.

npm install @zthun/identifier.angularjs --save

In your Angular main module, add the zthun.zidentifier module to your list of dependencies.

import { module } from 'angular';
module('my-module', ['zthun.identifier']);

This gives you access to the zid attribute directive. You can now dynamically generate ids based on your root component.

<div id="root">
    <div zid="component">
        <div zid="child-one"></div>
        <div zid="child-two"></div>
    </div>
</div>

The attribute can be bound to context data as well.

<div id="root">
    <div zid="component">
        <div ng-repeat="item in items" zid="child-{{item.id}}">
        </div>
    </div>
</div>

This will output the following HTML.

<div id="root">
    <div id="root-component">
        <div id="root-component-child-one"></div>
        <div id="root-component-child-two"></div>
    </div>
</div>

You can also use this for labels.

<div id="root">
    <form id="root-form">
        <label zfor="input">My Label</label>
        <input zid="input" type="text">
    </form>
</div>    

Build and Test

You will need the source repository first.

git clone https://github.com/zthun/zidentifier.angularjs

You can also fork the repository in preparation for a pull request back to the master branch.

Once you have the repository, you can build the solution using the following commands.

npm install
npm run make

Contribute

No further pull requests will be accepted for features or breaking changes of this package. Only critical bugs and patch fixes will be considered. If you wish to continue this package, it is better to fork and rebrand the package for your needs.

Package Sidebar

Install

npm i @zthun/identifier.angularjs

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

3.44 MB

Total Files

38

Last publish

Collaborators

  • zthun