angularjs-avataaars
v0.1.0
Published
Avataaars generator for AngularJS
Downloads
4
Readme
AngularJS Avatar Generator
A riff on https://github.com/TGA-CT/fangpenlin-avataaars-generator-angular in AngularJS
This package contains angular components, which allow you to generate SVG or PNG avatars from the set of options.
Installation
npm i angular-file-saver angularjs-avataaars --save
Usage
1 Add angular-file-saver and angularjs-avataaars to your html as scripts
<script src="node_modules/angular-file-saver/dist/angular-file-saver.bundle.min.js"></script>
<script src="node_modules/angularjs-avataaars/dist/avatar.min.js"></script>
or to Gulp
gulp.task('vendorjs', () => {
const filterJS = filter('**/*.js', { restore: true });
return gulp.src([
'node_modules/angular/angular.js',
'node_modules/angular-file-saver/dist/angular-file-saver.bundle.min.js',
'node_modules/angularjs-avataaars/dist/avatar.min.js',
])
.pipe(filterJS)
.pipe(concat('vendor.min.js'))
.pipe(uglify())
.pipe(gulp.dest('app/build/js/'));
});
2 Add it to your main module.
angular.module('myApp', ['avatarModule']);
3 Add components wherever you need them
<div class="root">
<avatar></avatar>
<avatar-controls></avatar-controls>
</div>
Development
While developing, use the gulp build process to enable SASS watch and BrowserSync. Run:
gulp
(or sudo gulp
)
Publish
Run gulp bundle
to generate minified file avatar.min.js
in the root level dist
folder.