2014-01-21

AngularJS MacGyver

And now we are talking about... AngularJS MacGyver, the duct tape and swiss army knife for AngularJS applications.

MacGyver provides a set of reusable components for AngularJS, for example:
  • autocomplete
  • tooltips
  • menus
  • and more...
You can see it in action with autocomplete tags:

http://starttheshift.github.io/MacGyver/example/#tag-autocomplete

How to setup MacGyver

Install it via bower:
$ bower install angular-macgyver --save
Add css:
<link rel="stylesheet" href="bower_components/MacGyver/lib/macgyver.css">
Load macgyver.js
<script src="bower_components/MacGyver/lib/macgyver.js"></script>
Just include Mac as a dependency:
angular.module(‘myModule’, [“Mac”])
And now you can use one of the provided directives, for example mac-autocomplete. If you get in trouble remember that the mac-autocomplete directive requires ng-model:
<mac-autocomplete
    ng-model="selected"
    mac-autocomplete-source="['hello', 'world']"
    mac-placeholder="'Autocomplete'">
</mac-autocomplete>
Done!

Links

he duct tape and swiss army knife for AngularJS applications. - See more at: http://tech.shift.com/post/58726393361/introducing-macgyver#sthash.mw58vg1J.dpuf
he duct tape and swiss army knife for AngularJS applications. - See more at: http://tech.shift.com/post/58726393361/introducing-macgyver#sthash.mw58vg1J.dpuf