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

primeng-schematics

v9.0.4

Published

Schematics for Prime NG

Downloads

204

Readme

PrimeNG

PrimeNG schematics (V7)

npm version npm GitHub license

This project is inspired by Angular Material Schematics and adds PrimeNG (V7) support to your Angular (V7) project.

Create a new angular project with PrimeNG support

with npm init npm init primeng my-primeng-app

or yarn create yarn create primeng my-primeng-app No globally installed NPM modules are required. Executing one of these commands will:

  1. create a new Angular 7 project called "my-primeng-app" (angular ng-new schematic)
  2. add PrimeNg support to the newly created project (primeng-schematics add schematic) - ensure project dependencies in package.json - ensure project dependencies in your app module - add prebuilt PrimeNG theme into angular.json and styles.<EXTENSION> files - add Prime icons - add Flex grid - add Chart.js - run npm install
  3. create sample dashboard component (png g dbr schematic), which includes: - primeNG menubar (png g mb schematic) - six types of primeNG charts (png g chr --type schematic) - primeNG table (png g t schematic)
  4. run ng serve -o command

The newly created app should now look like (with rhea default theme): newly created rhea app

Any additional Angular NG NEW or PrimeNG ADD options may be passed along with this command: npm init primeng my-primeng-app --minimal --interactive false --theme luna-amber

Test your new app (if the app was created without --minimal flag): npm test

Global installs

You may install @angular/cli, and primeng-schematics globally, which will expose ng and primeng-schematics (along with its alias png) global executables respectively: npm i @angular/cli primeng-schematics -g

In further examples I will assume that these packages are installed globally. It is also possible to use local or temporary cached with npx packages. So instead of running

$ ng add c componentName

alternatives ways may be used:

# using npx
$ npx @angular/cli c componentName
# using local package (must be run from the project root)
$ npm run ng -- c componentName
# the same using npm bin (note use of back ticks)
$ `npm bin`/ng c componentName
# the same using relative path
$ node_modules/.bin/ng c componentName

Similarly, instead of running

$ png help

alternatives ways are:

# using npx
$ npx primeng-schematics help
# using local package (must be run from the project root)
$ npm run png -- help
# the same using npm bin (note use of back ticks)
$ `npm bin`/png help
# the same using relative path
$ node_modules/.bin/png c componentName

To see Angular NG NEW options run: ng new --help

To see PrimeNG ADD options run: png add --help

Change theme palette (even while app is running)

png theme

and then choose the theme from the dialog or pass it with --theme flag, for example: png theme --theme luna-amber

After switching to luna-amber palette, the app should look like switch to luna-amber theme

to see available themes: png theme help

Generator Schematics

In addition to the install, PrimeNG schematic module has currently six schematics it comes packaged with:

Each component schematic will create a new angular component that includes PrimeNG component. (ng g is an alias for ng generate)

Menu bar schematics

$ ng g menubar <COMPONENT_NAME>

Organization chart schematics

$ ng g org-chart <COMPONENT_NAME>

Side bar schematics

$ ng g sidebar <COMPONENT_NAME>

Table

$ ng g table <COMPONENT_NAME> [--storage [none, session, local]]

Chart

$ ng g chart <COMPONENT_NAME> [--type [line, bar, doughnut, pie, polarArea, radar]]

Dashboard

$ ng g dashboard <COMPONENT_NAME>

You may also use png g command instead of ng g: png g dashboard my-dashboard

Too see components' aliases and options: png generate help

After executing one of these commands, a new angular component will be created with provided name. After this point you can add this new component to any existing component.

For example, assuming that you created <app-mb>, <app-oc>, <app-sb> and <app-t> components (menu bar, organization chart, side menu and table), you may modify your app.component.html file to something like:

<app-mb></app-mb>
<app-sb></app-sb>
<h1>
  Welcome to {{ title }}! 
</h1>
<app-oc></app-oc>
<app-t></app-t>

GENERAL HELP

png help

TODOS

  • Improve / fix / add tests
  • Implement ng-update schematic