我创建了一个角度拦截器来检查我的身份令牌的有效性.不知何故,do角度无法识别该方法.subscribe工作,但我不想要这个解决方案,因为它将我的请求加倍发送到服务器.
TypeError: next.handle(...).do is not a function
at AuthTokenService.webpackJsonp.../../../../../src/app/commons/services/interceptors/auth-token.service.ts.AuthTokenService.intercept (auth-token.service.ts:37)
at HttpInterceptorHandler.webpackJsonp.../../../common/esm5/http.js.HttpInterceptorHandler.handle (http.js:1796)
at XsrfService.webpackJsonp.../../../../../src/app/commons/services/interceptors/xsrf.service.ts.XsrfService.intercept (xsrf.service.ts:15)
at HttpInterceptorHandler.webpackJsonp.../../../common/esm5/http.js.HttpInterceptorHandler.handle (http.js:1796)
at HttpXsrfInterceptor.webpackJsonp.../../../common/esm5/http.js.HttpXsrfInterceptor.intercept (http.js:2489)
at HttpInterceptorHandler.webpackJsonp.../../../common/esm5/http.js.HttpInterceptorHandler.handle (http.js:1796)
at MergeMapSubscriber.project (http.js:1466)
at MergeMapSubscriber.webpackJsonp.../../../../rxjs/_esm5/operators/mergeMap.js.MergeMapSubscriber._tryNext (mergeMap.js:128)
at MergeMapSubscriber.webpackJsonp.../../../../rxjs/_esm5/operators/mergeMap.js.MergeMapSubscriber._next (mergeMap.js:118)
at MergeMapSubscriber.webpackJsonp.../../../../rxjs/_esm5/Subscriber.js.Subscriber.next (Subscriber.js:92)
Run Code Online (Sandbox Code Playgroud)
这是我的拦截器代码:
import { Injectable, NgModule} from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest} from
'@angular/common/http';
import { SessionService } from 'app/commons/services/auth/session.service';
import { HttpErrorResponse } from "@angular/common/http";
import { StateService } from '@uirouter/angular'; …Run Code Online (Sandbox Code Playgroud) 我推错了回购,现在管理员要我删除我的最后一次推送.我不能删除回购.

如何从回购中删除我的推送?
是否有一个等价array join()的Set类Ruby?或者最好只是在Set类中修补我自己?
我有包含数字和字符的字符串.我想用另一个值替换数字,这将给它一个css类someClass.
现在我得到了代码来检测字符串中的所有数字并用其他东西替换它.
我的问题是如何获得当前的数字匹配并将其添加到将替换原始数字的新字符串或值?
基本上我想要发生的是:
例如,我有这个字符串:1dog3cat,我希望它被替换为<span class="someClass">1</span>dog<span class="someClass">3</span>cat
这是我目前的代码:
var string_variable;
string_variable = "1FOO5,200BAR";
string_variable = string_variable.replace(/(?:\d*\.)?\d+/g, "<span class='someClass'>" + string_variable + "</span>");
alert(string_variable);
Run Code Online (Sandbox Code Playgroud) 我if在foreach循环中有一个声明.条件长约125个字符.还有其他方法来缩短这个吗?
if ($col == 'foo' || $col == 'bar' || $col == 'baz' || $col == 'fubar' || $col == 'spam' || $col == 'eggs') {
continue;
}
Run Code Online (Sandbox Code Playgroud)
注意:抱歉条件值的混淆'a',人们'b',...,...意味着各种各样的字符串.
我想知道下面代码中的这两个变量(invited、rsvps)中的空方括号有什么作用。
Parties.insert({
_id: id,
owner: this.userId,
x: options.x,
y: options.y,
title: options.title,
description: options.description,
public: !! options.public,
invited: [],
rsvps: [],
likes: 0,
});
Run Code Online (Sandbox Code Playgroud)