Giter Site home page Giter Site logo

alias's Introduction

ui-alias

Rename third-party directives or quickly generate simple template directives for use internally in your app!

  • Sick of the ui-* bs-* and other such prefixes cluttering up your beautiful html?
  • Always find you're calling the same set of directives together?

Now you can ALIAS it!

Installation

  1. Load alias.js
  2. Add ui.alias as a dependency
  3. Create a uiAliasConfig constant on the ui.alias module

Configuration

  • Create a constant on the ui.alias module
  • Keys are your alias, while the values are either a string template or a DirectiveDefinitionObject
  • Aliases create new directives that generate templates
  • Alias directives are replace: true by default unless explicitly set to false
angular.module('ui.alias').constant('uiAliasConfig', {
	'alias': '<template dir1 dir2 options="customConfigScopeVar"></template>', // becomes <alias>
	'alias2': {
		template: '<another-template></another-template>',
		restrict: 'AEC'
	}
	// Example:
	date: '<input ui-date ui-date-format="mm/dd/yyyy">'
	// becomes: <date>

});

Notes

  • Be careful to avoid creating an alias that fires recursively
    Example: <button> โ†’ <ui-button> โ†’ <button>
  • You cannot override existing directives. Both the original and your alias directives will execute.
  • You can create multiple an alias for different configurations of the same directives / templates

alias's People

Contributors

brandondrew avatar proloser avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.