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

angular-day04-day-5

v1.0.0

Published

- 凡是带link,src就可以用来跨域

Downloads

11

Readme

  • 凡是带link,src就可以用来跨域

假数据(放到一个数组里面) --> 放到一个json文件里面,通过angular的$http.get方法获取数据 -->在then方法里面接收数据 --> 渲染页面(ng-repeat) --> jsonp --> angular的jsonp怎么玩($http.jsonp方法) --> 自己封装一个jsonp方法,并且做为一个服务(复用代码和数据) --> 分页($routeParams),默认没传1 --> ng-click="" 在当前的基础上加1,减1 --> 防止出错(超出范围,不能小第1页,不能大于最大页)

jsonp = 构建一个script标签 + 创建一个全局回调函数(函数的名字必须要唯一,不能与别的函数冲突) + 去后台发送请求,接收数据 --> 数据是以实参的形式

  1. API是供别人用的,函数不能写死
  2. 函数名必须要由使用者提供(script标签是get方式,只能通过url后面的参数来提供函数,默认是callback)

angular当前这个页面如何渲染出来:(ngRoute) 通过hash锚点值 --> 路由(进入config里面的$routeProvider判断一下当前这个hash对应的) --> 控制器 --> 视图 --> 合成我们真的可以看到的东西

我们的ng-repeat的最后一项的$last值是true {{$last?'':'、'}} {{arr.join('、')}}

var arr = [1,32,4]; arr.join('、');

概念 API 工具 实例 typescript ES6