小编Bis*_*jit的帖子

TypeError:Object(...)不是函数

使用ionic3,angularfire2 v5

TypeError:Object(...)不是SwitchMapSubscriber._next上的SwitchMapSubscriber.project(http:// localhost:8100/build/vendor.js:73935:76)的函数(http:// localhost:8100/build/vendor.js:61778:27)在SwitchMapSubscriber.Subscriber.next(http:// localhost:8100/build/vendor.js:20750:18)的RefCountSubscriber.Subscriber._next(http:// localhost:8100/build/vendor.js:20786:26)在Subject.next(http:// localhost:8100/build/vendor)的RefCountSubscriber.Subscriber.next(http:// localhost:8100/build/vendor.js:20750:18). js:23237:25)在ConnectableSubscriber.Subscriber._next(http:// localhost:8100/build/vendor.js:20786:26)的ConnectableSubscriber.Subscriber.next(http:// localhost:8100/build/vendor. js:20750:18)在Asification.observe(http:// localhost:8100/build/vendor.js:51866:50)的AsyncAction.DelaySubscriber.dispatch(http:// localhost:8100/build/vendor.js: 76246:40)

home.ts

TypeError: Object(...) is not a function
    at SwitchMapSubscriber.project (http://localhost:8100/build/vendor.js:73935:76)
    at SwitchMapSubscriber._next (http://localhost:8100/build/vendor.js:61778:27)
    at SwitchMapSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20750:18)
    at RefCountSubscriber.Subscriber._next (http://localhost:8100/build/vendor.js:20786:26)
    at RefCountSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20750:18)
    at Subject.next (http://localhost:8100/build/vendor.js:23237:25)
    at ConnectableSubscriber.Subscriber._next (http://localhost:8100/build/vendor.js:20786:26)
    at ConnectableSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20750:18)
    at Notification.observe (http://localhost:8100/build/vendor.js:51866:50)
    at AsyncAction.DelaySubscriber.dispatch (http://localhost:8100/build/vendor.js:76246:40)
Run Code Online (Sandbox Code Playgroud)

home.html的 …

angularfire2 ionic3

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

ReferenceError:SSR Reactjs 中文档未定义问题

任何人都可以帮助我服务器端渲染(SSR),如果我从 webpack 中删除样式加载器,就会出现 CSS 代码问题。

webpack:///./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js?:93 var style = document.createElement('style'); ^

ReferenceError:文档未在 addStyle (webpack:///./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js?:93:15) 处定义/dist/runtime/injectStylesIntoStyleTag.js?:208:13) 在 moduleToDom (webpack:///./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js?:81:18) 在 module.exports (webpack: ///./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js?:239:25) 在 eval (webpack:///./src/App.css?:15:14) 在 Object../ src/App.css (C:\reactjs\ssr-demo\server-build\index.js:1:20922) 在 (C:\reactjs\ssr-demo\server-build\index.js:1:172 )在 eval (webpack:///./src/App.js?:4:66) 在 Module../src/App.js (C:\reactjs\ssr-demo\server-build\index.js: 1:21877) 在 (C:\reactjs\ssr-demo\server-build\index.js:1:172)

reactjs webpack server-side-rendering

5
推荐指数
0
解决办法
1949
查看次数

更新 .snapshotChanges() 代码以使用 angularfire2 5.0..0 rc-8、firebase 5.0.2

我已成功更新 angularfire 5.0.0.rc 8 和 firebase 5.0.2,没有错误模块。我想我要做的最后一件事是更改此代码以检索所有数据

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { IonicPage } from 'ionic-angular/navigation/ionic-page';
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
import { Note } from '../../model/note/note.model';
import { NoteListService } from '../../services/note-list.service';

@IonicPage()
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  noteList: Observable<Note[]>

  constructor(public navCtrl: NavController, private noteListService: NoteListService) {
    this.noteList = this.noteListService.getNoteList()
      .snapshotChanges()
      .map(
        changes => {
          return changes.map(c => ({
            key: c.payload.key, ...c.payload.val() …
Run Code Online (Sandbox Code Playgroud)

firebase angularfire2 ionic3 angular

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

如何使用连接到套接字的socket.id发送多个客户端(Node.js,Socket.io)

socket.on('private-message', function(data){
        console.log("Sending: " + data.content + " to " + data.username);
        console.log(clients[data.username].socket.join(', '));
        if (clients[data.username]){    
            io.sockets.connected[clients[data.username].socket].emit("add-message", data);
        } else {
            console.log("User does not exist: " + data.username);
        }
    });
Run Code Online (Sandbox Code Playgroud)

这段代码可以正常工作,但是我想要的是,我想使用其套接字ID发送多个连接到套接字的已连接客户端。

io.sockets.connected [reciver.socketid] .emit(“ add-message”,data);

有什么办法可以写接收者socket.id组吗?我不想使用for循环。

node.js socket.io

0
推荐指数
2
解决办法
1832
查看次数