0.1.0 • Published 10 years ago

angular-glossary v0.1.0

Weekly downloads
3
License
-
Repository
github
Last release
10 years ago

#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