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

pipe-ng-library

v1.6.5

Published

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.0.

Downloads

21

Readme

PipeNgLibrary

This project was generated with Angular CLI version 6.0.0.

usage

Download and install the package. npm install --save pipe-ng-library Once installed, import the ServiceModule in your application root module.

1: 引用DecodeService(解码) DeviceService(端) PermissionService(权限) 需先引入模块ServiceModule(import { ServiceModule } from 'pipe-ng-library';)

DecodeService
用decode方法,并传入需要解码的字符串decodeValue, decode(decodeValue)

DeviceService 调用device方法, 返回值:移动端true, pc端 false

PermissionService 调用 getPermission方法 ,传入token和需要返回的权限codeList(如['user_management', 'user_center']),验证接口为线上生产环境,getPermission(token, codeList, 'master'); 返回值为对应codeList权限的object, 传入的第三个参数为环境变量'dev'、'test'、'master',默认为'master' per.getPermission(token, perList).then(res => {console.log(res)});

LogoutService 调用logout, 传入token 和 环境变量(环境变量'dev'、'test'、'master',默认为'master'), 登出后跳到登录页

login

import the LoginModule in your application root module.

add <pipe-login [baseUrl]="baseUrl" [loginData]="loginData" [environment]="'test'" (loginSuccess)="loginSuccess($event)" (casBack)="casBack($event)" (loginFailed)="loginFailed($event)" [tip]="tip" [isInput]="false" [btnText]="'登录'" [customerType]="'B'" [btnDisabled]="true" (btnDisabledChange)="btnDisabledChange($event)"> in your application html

baseUrl 当前网站登录页地址,比如 ‘http://localhost:4200/login’ 。

loginSuccess登录成功后触发事件,返回token,username,password,loginSuccess(obj){ alert(obj);}

loginData 初始化用户名和密码 {username: '', password: ''}

loginFailed 登录失败返回错误信息

tip boolean类型 是否显示默认错误提示

casBack cas登录返回函数

isInput boolean类型 是否采用默认的输入框,默认为true(显示),点击登录按钮提交的是loginData绑定的值

btnText 按钮文字, 默认为‘登录’

environment 环境变量 dev(dev环境) test(test环境) master (master环境)

customerType 园区企业 B 运营方(能源服务商)ESP 监管方(园区管委会) ACP

btnDisabled 禁用登录按钮 默认为false, true是为禁用,并且会为按钮添加 p-btn-disabled的类名

btnDisabledChange 登录按钮禁用时点击事件

form-input

import the FormInputModule in your application root module.

add <form-input [placeholder]="'请输入姓名'" [(inputValue)]="formvalue" [pattern]="'[0-9A-Za-z]{2,16}'" [error]="true" [required]="true" [width]="300" [warmTip]="'请输入姓名'"> in your application html

inputValue 提供输入框数据双向绑定

pattern 输入框正则匹配

error 是否强制显示错误格式 ,默认为 false

warmTip 错误显示提示文字

userWarmTip 自定义验证错误信息 优先warmTip 长度为0时显示warmTip 否则显示 userWarmTip