npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nationalbankbelgium/angular-mdi-svg

v1.7.0

Published

Material Design Icons mdi.svg file for using with Angular(JS) Material

Downloads

1

Readme

@nationalbankbelgium/angular-mdi-svg

Material Design Icons mdi.svg file for Angular(JS) Material. Based on MaterialDesign project, there is a CRON behind this project to pull the latest version of the mdi.svg file from https://materialdesignicons.com.

Installation

Install @nationalbankbelgium/angular-mdi-svg from npm

npm install @nationalbankbelgium/angular-mdi-svg --save

Usage

This bundle is usable with Angular(JS) Material and to facilitate his usage, it's recommended to use copy-webpack-plugin.

Add the following plugin configuration in webpack config:

new CopyWebpackPlugin([
  { from: 'node_modules/@nationalbankbelgium/angular-mdi-svg/mdi.svg',
    to: 'assets/mdi.svg'
  }
]);

Angular 2.x/4.x/5.x

The following explanations come from MaterialDesign

The mdi.svg contains all the icons provided on the site. Use inline with MatIconRegistry. The following assumes that you're using the latest version of @angular/material (5.0.0-rc.0) and you already have the basic knowledge of Angular Material. In your app's module file (typically app.module.ts), import MatIconModule and MatIconRegistry from @angular/material:

import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { MatIconRegistry, MatIconModule } from '@angular/material';
import { DomSanitizer } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
/*
From the latest master, HttpClientModule is required instead
import { HttpClientModule } from '@angular/common/http';
*/

...
@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    HttpModule,
    // From the latest master, HttpClientModule is required instead
    // Your other modules
    // Take note that you have to import MatIconModule into your app
    MatIconModule
  ]
})
export class AppModule {
  constructor(matIconRegistry: MatIconRegistry, domSanitizer: DomSanitizer){
    matIconRegistry.addSvgIconSet(domSanitizer.bypassSecurityTrustResourceUrl('./assets/mdi.svg')); // Or whatever path you placed mdi.svg at
  }
}

If you're using Angular CLI, make sure to include assets folder under .angular-cli.json in assets array (Although by default, the angular CLI will autofill it in):

{
   "apps": [
     {
       "assets": [
         "assets"
       ]
     }
   ]
}

Usage:

<!-- Icon by itself -->
<mat-icon svgIcon="android"></mat-icon>
<!-- Icon button -->
<button mat-icon-button>
  <mat-icon svgIcon="android"></mat-icon>
</button>
<!-- You can also combine an icon and text together -->
<button mat-button>
  <mat-icon svgIcon="code-tags"></mat-icon>
  View source
</button>

Please also add the following class to your styles (styles.css) to solve the problem where an icon isn't aligned properly when used in a menu item:

button.mat-menu-item {
  line-height: 24px !important;
}
a.mat-menu-item > mat-icon {
  margin-bottom: 14px;
}
.mat-icon svg {
  height: 24px;
  width: 24px;
}

Demo

For more information on icons, refer to the icon docs.

Angular JS Material

The following explanations come from MaterialDesign

The mdi.svg contains all the icons provided on the site. Use inline with $mdIconProvider.

var app = angular.module('myApp', ['ngMaterial']);
app.config(function($mdIconProvider) {
  $mdIconProvider
    .defaultIconSet('assets/mdi.svg')
});

Usage:

<md-icon md-svg-icon="android"></md-icon>
<md-button aria-label="Android" class="md-icon-button">
  <md-icon md-svg-icon="android"></md-icon>
</md-button>

Contributing

Submitting Pull Requests

Please follow these basic steps to simplify pull request reviews - if you don't you'll probably just be asked to anyway.

  • Please rebase your branch against the current master
  • Run npm install to make sure your development dependencies are up-to-date
  • Please ensure the test suite passes before submitting a PR
  • If you've added new functionality, please include tests which validate its behaviour
  • Make reference to possible issues on PR comment

Submitting bug reports

  • Please detail the affected browser(s) and operating system(s)
  • Please be sure to state which version of node and npm you're using

License

This project is licensed under the terms of the MIT License open source license. You can find the complete terms in the LICENSE file.