小编baj*_*032的帖子

代码.不被视为内部或外部命令

我想在visual studio代码中使用cmd打开目录,但它在cmd中给我错误.那么,需要什么设置呢?

我执行了以下命令

D:\RND>code .
Run Code Online (Sandbox Code Playgroud)

visual-studio-code vscode-settings vscode-tasks

13
推荐指数
5
解决办法
3万
查看次数

在哪里可以找到 vscode 中的共享选项?

我目前正在研究 1.8 版的 vs 代码。最近微软推出了名为Visual Studio Live Share 的新功能。我的问题是我找不到共享按钮或菜单/子菜单。

如果您知道在哪里可以找到或如何使用 vs 代码共享代码,请帮助我。

visual-studio-code vscode-settings

5
推荐指数
1
解决办法
866
查看次数

Chrome不支持Service Worker(69.0.3497.81)

我开始使用PWA(渐进式Web应用程序)。当我尝试检查Chrome浏览器是否支持Service Worker时,始终返回false。下面的代码我用于检查。

注意:我使用的是chrome版本69.0.3497.81(正式版本)(64位)。

app.js

if ('serviceWorker' in navigator) {
    navigator.serviceWorker.register('/sw.js').then(function() {
        console.log('service worker registered');
    });
}
Run Code Online (Sandbox Code Playgroud)

需要帮助以在Chrome中注册服务人员。

progressive-web-apps

4
推荐指数
1
解决办法
3567
查看次数

角度生命周期事件调用没有实现接口?

我正在使用角度应用程序,我发现角度生命周期事件是没有实现接口的调用.在下面的例子中,如果我从组件中删除接口,那么所有角度生命周期钩子都正常工作.关于没有实现接口的问题,为什么angular会调用所有事件?

我知道在typescript中我们可以使用我们可以用于c#的所有OOP概念.

生命cycle.component.ts

import {
  Component,
  OnInit,
  OnChanges,
  SimpleChanges,
  Input,
  AfterViewInit,
  DoCheck,
  AfterViewChecked,
  AfterContentChecked,
  AfterContentInit,
  OnDestroy
} from '@angular/core';

@Component({
  selector: 'app-life-cycle',
  templateUrl: './life-cycle.component.html',
  styleUrls: ['./life-cycle.component.css']
})
export class LifeCycleComponent
  implements
    OnChanges,
    OnInit,
    DoCheck,
    AfterViewInit,
    AfterViewChecked,
    AfterContentChecked,
    AfterContentInit,
    OnDestroy {
  @Input('appTitle') appTitle: string;
  constructor() {
    console.log('constructor called!');
  }

  ngOnChanges(changes: SimpleChanges) {
    console.log('ngOnChanges called!');
    console.log(changes);
  }
  ngOnInit() {
    console.log('ngOnInit called!');
  }

  ngDoCheck() {
    console.log('ngDoCheck called!');
  }

  ngAfterViewInit() {
    console.log('ngAfterViewInit called!');
  }
  ngAfterViewChecked() {
    console.log('ngAfterViewChecked called!');
  }
  ngAfterContentInit() {
    console.log('ngAfterContentInit called!'); …
Run Code Online (Sandbox Code Playgroud)

typescript angular

1
推荐指数
1
解决办法
828
查看次数

在@ngrx/effects 中调用 http 之前的调度操作

我想为我使用 rxjs 的效果进行 http 调用。现在我的问题是我想像{ type: LoaderActions.LOADER_START }在 http 调用之前一样调度另一个动作。所以用户可以在请求 Http 调用时看到加载屏幕,一旦请求完成,我想调度另一个动作{ type: LoaderActions.LOADER_END }

如何使用 rxjs 运算符实现此目的?我对何时在 rxjs 中使用哪个运算符感到非常困惑。

auth.effects.ts

import { Injectable } from '@angular/core';
import { Observable, of, concat } from 'rxjs';
import { Action, Store } from '@ngrx/store';
import { Actions, Effect, ofType } from '@ngrx/effects';
import * as AuthActions from './auth.actions';
import * as LoaderActions from '../../loader/store/loader.actions';
import {
  map,
  mergeMap,
  switchMap,
  debounce,
  debounceTime,
  tap,
  startWith
} from 'rxjs/operators';
import { …
Run Code Online (Sandbox Code Playgroud)

rxjs ngrx-effects angular

1
推荐指数
1
解决办法
2537
查看次数