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

admin-lte-ng

v0.4.22

Published

AdminLTE Angular2

Downloads

17

Readme

Deployment

Make sure you have any pending change in git

  - npm version patch -m "Upgrade to %s [skip ci]"
  - git push && git push --tags

Installation

This lib is only tested on angular-cli project, but it probably can work elsewhere...

To install this lib on your project : yarn add ngx-admin-lteor npm install ngx-admin-lte

in your app.modules.ts


@NgModule({
  ...
imports: [
  ...
  NgxAdminLteModule,

add js and css of admin-lte in your project. like so:

in your angular-cli.json

"assets": [
      { "glob": "**/*", "input": "../node_modules/ngx-admin-lte/src/public/assets", "output": "./assets" }
...
    ],
"scripts": [
      "../node_modules/jquery/dist/jquery.js",
      "../node_modules/bootstrap/dist/js/bootstrap.js",
      "../node_modules/admin-lte/dist/js/app.js"
    ],

in your style.css

@import "../node_modules/bootstrap/dist/css/bootstrap.css";
@import "../node_modules/font-awesome/css/font-awesome.css";
@import "../node_modules/admin-lte/dist/css/AdminLTE.css";
@import "../node_modules/admin-lte/dist/css/skins/skin-blue.css";
@import "../node_modules/ionicons/dist/css/ionicons.css";

then you can declare your component with the adminLte template in your router:

import { CanActivateGuard, LayoutAuthComponent } from 'ngx-admin-lte';
...
const routes: Routes = [
// logged routes
{
  canActivate: [CanActivateGuard],
  children: [
    {
      canActivate: [CanActivateGuard],
      component: HomeComponent,
      path: 'home'
    },
    {
      canActivate: [CanActivateGuard],
      component: PageNumComponent,
      path: 'page/:id'
    },
  ],
  component: LayoutAuthComponent,
  path: '',
},
// not logged routes
{
  component: LayoutLoginComponent,
  path: 'login'
},
{
  component: RegisterComponent,
  path: 'register'
}
];

Services

Menu service

You can set the menu links, globally (if you do that in your app.component.ts for example), or locally, if you do that in each of your component

import { User, MenuService, Message, MessagesService } from 'ngx-admin-lte';
...

// define here your own links menu structure
private mylinks: any = [
  {
    'title': 'Home',
    'icon': 'dashboard',
    'link': ['/']
  },
  {
    'title': 'Sub menu',
    'icon': 'link',
    'sublinks': [
      {
        'title': 'Page 2',
        'link': ['/page/2'],
      },
      {
        'title': 'Page 3',
        'link': ['/page/3'],
      }
    ]
  }
];

constructor(
  private menuServ: MenuService,
  private msgServ: MessagesService
) {

}

public ngOnInit() {
  // define menu
  this.menuServ.setCurrentMenu(this.mylinks);

Logo Service

You can define your own brand name in the logo

Import { LogoService } from 'ngx-admin-lte';

constructor( private logoServ: LogoService ){

...

this.logoServ.setCurrentLogo({ //used for reduced menu small: { bold: 'A', normal: 'LT' }, //used for normal state big: { bold: 'Admin', normal: 'LTE' } });

User service

This service is used to send/get the current user informations accross the app

For example you can set the current user, in your login page :

import {User, UserService} from 'ngx-admin-lte';
...
constructor(
  private _user_serv: UserService
){
...
ngOnInit(){
  let user = new User({
    firstname: "WEBER",
    lastname: "Antoine",
    email: "[email protected]",
    avatarUrl: "assets/img/user2-160x160.jpg"
  });
  this._user_serv.setCurrentUser( user );

and you can get the user in a widget:

import {User, UserService} from 'ngx-admin-lte';
...
private current_user: User;
constructor(
  private _user_serv : UserService,
){
  //se connecter au modification du user courant
  this._user_serv.current_user.subscribe((user: User) => this.current_user = user);

Specific Components

App Header

This widget handle the header bar, it includes other 'box' widgets for the top navigation:

  • Messages Box
  • Notification Box
  • Tasks Box
  • User box

Messages Box

This widget is registred to the messages service

Notification Box

WIP This widget is registred to the notification service

Tasks Box

WIP This widget is registred to the task service

User box

This widget is registred to the user service (for the current user display)

Menu Aside

This widget handle the left navigation Menu

It is registred to the user service (for the current user display)

Models

User

  • firstname: string, First Name of the user
  • lastname : string, Last Name of the user
  • email : string, Email address of the user
  • avatarUrl : string, URL for the user avatar, could be absolute or relative
  • creation_date : string, timestamp of the creation of the user

Message

  • title : string, title of the message
  • content : string, content of the mesage
  • author : User, source user of the message
  • destination : User, destination user of the message
  • date : string, date of sending