Socket
Socket
Sign inDemoInstall

ng2-avatar

Package Overview
Dependencies
5
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ng2-avatar

[![npm version](https://img.shields.io/npm/v/ng2-avatar.svg?style=flat-square)](https://www.npmjs.com/package/snic/ng2-avatar) [![devDependencies Status](https://img.shields.io/david/dev/snics/ng2-avatar.svg?style=flat-square)](https://david-dm.org/snics/


Version published
Maintainers
1
Created

Changelog

Source

2.0.4 (2017-08-28)

<a name="2.0.3"></a>

Readme

Source

ng2-avatar

npm version devDependencies Status Dependencies Status license

Angular 2/4 Avatar (ng2-avatar) is a simple and lightweight component that generates a letter's avatar or displayed a picture from Gravatar API

Installation

  1. Install the npm package.
npm i --save ng2-avatar
  1. Import AvatarComponent in your application :
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';

import { AvatarModule } from "ng2-avatar";

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    AvatarModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Usage

  <avatar [email]="email" [displayType]="'circle'"></avatar>
  <input type="email" [(ngModel)]="email">

Configuration

configuration optiontypedefaultdescription
emailStringnoneThis email is for generated the initials letters or get the picture from Gravatar API (required)
namestringnoneThis name is for generated the initials letters (required)
sizenumber100Is the size of the image and avatar
backgroundstringRandom colorThe background colors for the letter's avatar
displayTypestringcirclenone, circle, rounded
letterstring?These are the default letter

Dependencies

  • ts-md5 - The Md5 hashing framework used

(The MIT License)

Copyright (c) 12.05.17 Nico Swiatecki - Initial work - Snics

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Last updated on 28 Aug 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc