小编use*_*021的帖子

无法确定组件角度的模块5

当我使用"ng build --prod"构建Angular应用程序时,我遇到了以下错误.当我使用Angular 4构建并且使用Angular 5获得错误时,这是​​有效的.使用Angular 5"ng serve"工作正常.

错误中的错误:无法在mypath/node_modules/time-ago-pipe/time-ago-pipe.ts中确定类TimeAgoPipe的模块!将TimeAgoPipe添加到NgModule以修复它.

获取https://www.npmjs.com/package/time-ago-pipe的错误

有解决方案吗

angular angular5

21
推荐指数
5
解决办法
2万
查看次数

一个页面中的多个Redactor编辑器实例无法正常工作

我使用"redactor"(http://imperavi.com/redactor)作为我的HTML编辑器.当一个页面中有多个编辑器时,如果我使用其ID使用每个编辑器进行初始化,这将完美地工作.但是当我使用它的类初始化时,第一个只能完美地工作.

我使用以下代码来初始化它

$(".htmlEditor").redactor();
Run Code Online (Sandbox Code Playgroud)

第一个编辑工作.如果我按下第二个或其他编辑器的格式按钮,焦点会跳转到第一个编辑器.

如果我使用其ID分别初始化每个编辑器,那么所有编辑器都在工作.

但我想要使用类,因为编辑器是动态添加到页面的.

我已经使用了其他jquery插件(在一个页面中使用类进行初始化的多个实例),应该有一种方法可以在这个插件中执行此操作.

我错过了吗?或者我必须做任何配置?

jquery redactor redactor.js

8
推荐指数
2
解决办法
1137
查看次数

当应用程序处于前台时,Angular 8 firebase 推送通知不起作用

我正在按照此文档在我的 Angular Web 应用程序上实现 FCM。当我发送通知时,它会在应用程序未处于活动状态时成功接收。(接收后台通知)。但是如果应用程序处于活动状态,我就不会收到通知。

按照以下步骤操作:https : //dev.to/mayurkadampro/angular-8-firebase-cloud-messaging-push-notifications-97a

基本上这不会在有新消息时触发

this.angularFireMessaging.messages.subscribe(
(payload) => {
    console.log("new message received. ", payload);
    this.currentMessage.next(payload);})
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

firebase-cloud-messaging angular

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

Laravel - 获取没有表列名的数据库结果

我希望结果只包含 Laravel 4.2 中不包含表列名的值。例如,

$recs = DB::table('table_name')
        ->select('id', 'title')
        ->get();
Run Code Online (Sandbox Code Playgroud)

结果是

array(2) {
  [0]=>
  object(stdClass)#863 (2) {
    ["id"]=>
    int(2)
    ["title"]=>
    string(8) "my title"
  }
  [1]=>
  object(stdClass)#862 (2) {
    ["id"]=>
    int(3)
    ["title"]=>
    string(10) "my title 2"
  }
}
Run Code Online (Sandbox Code Playgroud)

但我只想得到结果而不是列名,比如

[
  2,
  "my title"
],
[
  3,
  "my title 2"
]
Run Code Online (Sandbox Code Playgroud)

是的,我可以通过循环结果并创建没有列名的新数组来实现。但是有没有办法使用 Laravel 以这种方式获得结果?

laravel laravel-4.2

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

为网络和离子应用程序设置不同的“ click_action”

我有一个Web应用程序(Angular 6)和移动应用程序(Ionic 4),并且都连接到同一个数据库。我正在使用FCM(Firebase云消息)进行推送通知。我关注了2个链接1. https://www.djamware.com/post/5c6ccd1f80aca754f7a9d1ec/push-notification-using-ionic-4-and-firebase-cloud-messaging 2. https://medium.com/@selvaganesh93 / firebase-cloud-messaging-important-rest-apis-be79260022b5

我已经为每个用户创建了FCM“组”。这意味着用户可以使用多个设备(浏览器或移动设备)登录到该应用程序,并且该用户将拥有一个“ fcm_notification_key”,其中包含来自不同设备的FCM令牌。

因此,现在当应用程序将任何通知推送到此唯一的“ fcm_notification_key”键时,与该键连接的所有设备(网络和离子应用程序)都将收到。这很正常。

  "notification":{
    "title":"Notification Title",
    "body":"Notification Body",
    "click_action" : "myweb.com/specific_url",
  }
Run Code Online (Sandbox Code Playgroud)
  "notification":{
    "title":"Notification Title",
    "body":"Notification Body",
    "click_action" : "FCM_PLUGIN_ACTIVITY",
  }
Run Code Online (Sandbox Code Playgroud)

首先是使用Web,当用户单击通知时,将在浏览器中打开“ click_action”中指定的URL。哪个是正确的。

第二个是使用Ionic应用程序。用户单击通知时,由于为“ click_action”指定了“ FCM_PLUGIN_ACTIVITY”,因此它将打开Ionic应用程序。这也是正确的。

但是问题是,现在我正在向网上论坛发送通知(该网上论坛将包含Web应用程序和ionic应用程序)。我应该如何发送数据,以使其适用于网络和离子数据?

firebase-cloud-messaging angular ionic4

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

删除 SafetyNet 后 Flutter firebase_auth 崩溃

我的 flutter 应用程序正在使用 firebase_auth (v 4.2.1)插件来验证电话号码,效果非常好。但后来我收到了来自 Google Play 的“迁移您的 Google SafetyNet Attestation API”警告。当我搜索时,发现“firebase_auth”插件中使用了“SafetyNet”。至于这个问题的解决方案,我找到了这个链接(Flutter Play Store警告:play-services-safetynet 2022)。

dependencies {
  implementation platform('com.google.firebase:firebase-bom:30.3.2')
  implementation 'com.google.firebase:firebase-auth'
}
configurations.all {
    exclude group: 'com.google.android.gms', module: 'play-services-safetynet'
}
Run Code Online (Sandbox Code Playgroud)

它从依赖项列表中删除“SafetyNet”。现在,当尝试验证电话号码并收到以下错误时,应用程序崩溃了。

E/AndroidRuntime(15766): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/safetynet/SafetyNet;
E/AndroidRuntime(15766):    at com.google.firebase.auth.internal.zzf.zza(com.google.firebase:firebase-auth@@21.1.0:2)
E/AndroidRuntime(15766):    at com.google.firebase.auth.FirebaseAuth.zzI(com.google.firebase:firebase-auth@@21.1.0:26)
E/AndroidRuntime(15766):    at com.google.firebase.auth.PhoneAuthProvider.verifyPhoneNumber(com.google.firebase:firebase-auth@@21.1.0:2)
E/AndroidRuntime(15766):    at io.flutter.plugins.firebase.auth.PhoneNumberVerificationStreamHandler.onListen(PhoneNumberVerificationStreamHandler.java:180)
E/AndroidRuntime(15766):    at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:218)
E/AndroidRuntime(15766):    at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:197)
E/AndroidRuntime(15766):    at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/AndroidRuntime(15766):    at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/AndroidRuntime(15766):    at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(D8$$SyntheticClass)
E/AndroidRuntime(15766):    at android.os.Handler.handleCallback(Handler.java:751)
E/AndroidRuntime(15766):    at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(15766):    at android.os.Looper.loop(Looper.java:154)
E/AndroidRuntime(15766):    at android.app.ActivityThread.main(ActivityThread.java:6077)
E/AndroidRuntime(15766): …
Run Code Online (Sandbox Code Playgroud)

firebase-authentication flutter safetynet

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

Laravel“查找”方法“哪里 id = ?” 给出错误的结果

我正在使用 Laravel 7。我有名为“Stores”的表,列“id”是主键和自动增量。

\n

当我运行时Store::find(9)->first()它给出错误的结果,当我运行时Store::where('id', 9)->first()给出正确的结果。

\n

我启用了查询日志并得到了关注。

\n

为了Store::find(9)->first()

\n
array:2 [\n  0 => array:3 [\n    "query" => "select * from "stores" where "stores"."id" = ? limit 1"\n    "bindings" => array:1 [\n      0 => 9\n    ]\n    "time" => 6.41\n  ]\n  1 => array:3 [\n    "query" => "select * from "stores" limit 1"\n    "bindings" => []\n    "time" => 0.53\n  ]\n]\n
Run Code Online (Sandbox Code Playgroud)\n

并为Store::where('id', 9)->first()

\n
array:1 [\xe2\x96\xbc\n  0 => array:3 [\xe2\x96\xbc\n    "query" => "select * …
Run Code Online (Sandbox Code Playgroud)

postgresql laravel laravel-7

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