Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.
/ alias Public archive

Create concise aliases for third-party directives and templates

Notifications You must be signed in to change notification settings

angular-ui/alias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

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 aliases for different configurations of the same directives / templates

About

Create concise aliases for third-party directives and templates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •