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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ionicx-wechat-like-album

v0.0.3

Published

a album is like the wechat for ionic

Readme

git;

类似微信朋友圈添加图片的ionc组件(可滑动浏览,可缩放)

图片所示是限制了权限,不能添加,不能删除,所以小图后面看不到‘+’,大图右上角没有删除标记垃圾桶。

!image !image

使用前配置

npm i ionicx-wechat-like-album --save;

import { PhotoViewComponentModule } from 'ionicx-wechat-like-album';
把 PhotoViewComponentModule 放到你的的顶级shareModule里,因为这是在每个次级模块都会导入的,比较方便
import { PhotoViewComponentModule } from 'ionicx-wechat-like-albume';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from 'ionic-angular';
import { FormsModule } from '@angular/forms';


@NgModule({
    imports: [CommonModule, IonicModule, FormsModule],
    declarations: [],
    exports: [CommonModule, IonicModule, FormsModule, PipesModule, PhotoViewComponentModule,DirectivesModule],
    entryComponents: [],
    providers: []
})
export class SharedModule { }
对于懒加载的页面,需要再次导入PhotoViewComponentModule;
import { NgModule } from '@angular/core';
import { MeComponent } from './me.component';
import { IonicPageModule } from 'ionic-angular';

import { PhotoViewComponentModule } from 'ionicx-wechat-like-albume';

@NgModule({
  declarations: [MeComponent],
  imports: [IonicPageModule.forChild(MeComponent), PhotoViewComponentModule],
  entryComponents: [
    MeComponent
  ],
  providers: []
})
export class MeComponentModule { }

使用

html

<sg-photo-view></sg-photo-view>

页面控制

myOpts = {
    addable: true,//是否能添加图片
    scanable: true,//是否进入能浏览图片
    removeable: true,//是否能移除图片
  }

以上是默认值,可通入[opts]传入去修改,如

<sg-photo-view [opts]="{addable:false,removeable:false}"></sg-photo-view>

添加图片

当按+正方按钮去时会emit方法addOnePicture;第一个参数是一个方法,传入url或base64就可以。如:

<sg-photo-view (addOnePicture)="add($event)"></sg-photo-view>

ts里

add(a:any){
    let picture = youGetPicture();
    a(picture);
}

如何获得组件的图片数组,有两种方法

  1. 每次修改会emit方法imgsChange,参数一就是了
  2. 使用angular的Form,绑定[(ngModel)]="binding",或formControlName="binding"

Done,thanks