小编Mar*_*rác的帖子

在配置文件中为ng服务设置默认主机和端口

我想知道我是否可以在配置文件中设置主机和端口,所以我不必输入

ng serve --host foo.bar --port 80
Run Code Online (Sandbox Code Playgroud)

而不仅仅是

ng serve
Run Code Online (Sandbox Code Playgroud)

angular-cli angular

154
推荐指数
8
解决办法
20万
查看次数

反应导航和组件生命周期

我有一个使用反应导航的 React Native 应用程序。在我的一个屏幕中,我使用相机读取二维码,效果很好,但我必须使用 setState({camera: false}) 来防止多次加载二维码。通常,它有效。即使从主菜单重新进入页面后也是如此。

问题是,当用户按下“<”按钮(iOS / 标题中)时,他应该使用相机重新进入页面。我找不到应该执行 setState({camera: true}) 的函数。如果没有反应导航,就有标准的生命周期(componentWillMount,...),但在这种情况下,我无法找到放置代码的位置,因此我可以检测到该页面已重新进入。

我知道https://github.com/react-community/react-navigation/issues/51但我仍然想念解决方案。

react-native react-navigation

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

Permission denied when getting comments from my page via FB Graph API

Just recently, my attempts to get comments of my post via API fails with Permission denied. I'm pretty sure that it worked before (early Aug 2021).

I'm able to get posts of my page (in both API and Graph Explorer) via /ID/posts but I'm not able to get user generated content via /ID_POST/comments. I got

{
  "error": {
    "message": "(#200) Missing Permissions",
    "type": "OAuthException",
    "code": 200,
    "fbtrace_id": "AQuGaEEWWkJ_L380WhfeDPy"
  }
}
Run Code Online (Sandbox Code Playgroud)

but I have page token with pages_read_engagement, pages_show_list, pages_read_user_content (what …

facebook-graph-api

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

peekRecord() 不工作,但 peekAll() 工作

我的后端总是用所有可用的数据进行响应,这花费了相当多的时间。所以我定期重新加载商店,我计划使用 peekAll() 和 peekRecord()。

我的代码是:

model: function() {
  return Ember.RSVP.hash({
    'clusters': this.store.peekAll('cluster'),
    'single': this.store.peekRecord('cluster', 'cluster::My')
});
Run Code Online (Sandbox Code Playgroud)

执行代码时,起初我可以看到这两个项目都不包含内容。几秒钟后,数据被加载到存储中,我可以按预期在模板上看到内容“集群”。但是 'single' 仍然完全没有内容({{model.single}} 在模板中不返回任何内容)。但是当我有一个带动作的按钮时:

alert(this.store.peekRecord('cluster', 'cluster::My'));
Run Code Online (Sandbox Code Playgroud)

我可以看到记录已找到。记录也可通过 Ember Inspector 获得。我做错了什么,只有 peekAll() 适合我的模型。

ember.js ember-data

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