New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

angular-plugins-http

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-plugins-http

封装angular http

npmnpm
Version
1.2.9
Version published
Weekly downloads
4
-87.1%
Maintainers
1
Weekly downloads
 
Created
Source

使用方法

    # 需要依赖
    npm install angular

    # 安装
    npm install angular-plugins-http

    #使用

    #angular
    angular.module("app", ["http"]);

    <!-- 设置全局token变量名 -->
    window.localStorage.accessToken="accessToken";

    <!-- 设置token值 -->
    window.localStorage.token="abc";

    <!-- post请求 -->
    data 为提交的数据
    url 为请求地址
    params 为请求地址的参数
    http.post({data: Array,url: http url,params:Object})

    <!-- get请求 -->
    url 为请求地址
    params 为请求地址的参数
    http.get({url: http url,params:Object})

    <!-- 设置token名称 -->
    window.localStorage.accessToken = "token";

    <!-- 设置token值 -->
    window.localStorage.token = "token";

    <!-- 获取当前地址的参数,如果没有则返回null -->
    http.getParams(参数名称);
    或者
    http.getParams(参数名称,[你的url地址否则是当前地址]);

    <!-- 给当前地址添加参数,并返回当前地址 -->
    http.setParams(参数名称,参数值,[你的url地址否则是当前地址]);

    <!-- 更新当前地址某个参数,并替换当前地址 -->
    http.replaceState(参数名称,参数值,[你的url地址否则是当前地址]);

    <!-- 添加一个历史记录 -->
    http.pushState(参数名称,参数值,[你的url地址否则是当前地址]);

    <!-- 合并两个json -->
    http.extend(原json,新json);




    请求地址默认会在url地址加上timestamp时间戳.

FAQs

Package last updated on 16 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts