Skip to content

A directive that outputs a glossary based on a collection of terms.

License

Notifications You must be signed in to change notification settings

DevLab2425/angular-glossary

Repository files navigation

#angular-glossary NPM version Bower version Github version

A directive that outputs a glossary based on a collection of terms.

Installation

Download angular-glossary.min.js or install with bower

$ bower install angular-glossary --save

Load angular-glossary.min.js, then add the angular-glossary module to your application.

angular.module('yourApp', ['angular-glossary']);

Usage

HTML

<body ng-app="glossaryExample">
	<div ng-controller="glossaryCtrl">
		<glossary terms="{{terms}}"></glossary>
	</div>
</body>

Javascript

angular.module('glossaryExample', ['angular-glossary'])
	.controller('glossaryCtrl', ['$scope', function($scope){
		$scope.terms = [
			{
				term: 'Banana',
				definition: 'A long, yellow fruit that monkeys love to eat.'
			},
			{
				term: 'Apple',
				definition: 'A round, green or red fruit that crunches when you bite it.'
			},
			{
				term: 'Watermelon',
				definition: 'A very large round fruit that\'s green on the outside and red on the inside.'
			},
			{
				term: 'Grape',
				definition: 'Small round, red or green fruits on a bunch.'
			},
			{
				term: 'Strawberry',
				definition: 'Small red, tri-AngularJS fruit with seeds on the outside.'
			}
		];
	}]);

Example

The example app can be launched using a simple web server, however, it is dependent on a CDN hosted instance of Angular. You'll need to localize Angular to run completely local.

Development

Testing is done using Karma Test Runner.

$ grunt test

Build

$ grunt build

About

A directive that outputs a glossary based on a collection of terms.

Resources

License

Stars

Watchers

Forks

Packages

No packages published