小编Eug*_*hel的帖子

"使用严格"为TypeScript代码添加了什么?

此问题是TypeScript文件中所需"使用严格"的副本

有一些答案,但是当没有这个语句时,tsc让我严格模式错误时,不清楚TypeScript中的"use strict"语句是什么.

但是决定好好分开问题.

我正在使用TypeScript 1.6,对我而言,目前还不清楚TypeScript中的"use strict"语句是什么?

使用"严格使用"; 声明看起来像是双重检查.由于tsc在没有此语句的情况下显示严格模式错误

例如:

class Foo {
03;
constructor(public name:string) {
}

move(meters:number) {

    let o = {p: 1, p: 2};

    let a;
    delete a;
    alert(this.name + " moved " + meters + "m.");

}

sum(a:number, a:number, c:number):number { 
    var sum = 015 +
        197 +
        142;


    var x = 17;
    with (obj)
    {
        x;
    }

    [1, 2, 3, 4, 5].map(function (n) {
        return !(n > 1) ? 1 …
Run Code Online (Sandbox Code Playgroud)

strict typescript typescript1.6

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

如何在facebook Messenger中显示个性化的"欢迎信息"?

我想展示'欢迎信息',如'嗨罗伯特,欢迎来到我的申请'.所以我需要发送:

  1. " https://graph.facebook.com/v2.6/USER_ID?fields=first_name,last_name,profile_pic,locale,timezone,gender&access_token=PAGE_ACCESS_TOKEN "

  2. 使用第一个请求中的"first_name",发送" https://graph.facebook.com/v2.6/PAGE_ID/thread_settings?access_token=PAGE_ACCESS_TOKEN "请求以设置"欢迎消息".

但是,我需要在第一次请求之前知道user_id.

我的问题:

  1. 创建"欢迎信息"的步骤是什么?
  2. 当用户打开facebook messenger窗口时,如何显示"欢迎信息"?

我查看了https://developers.facebook.com/docs/messenger-platform文档,我仍然有疑问.

facebook facebook-graph-api facebook-messenger

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

是否可以将渐变颜色用于带有 react-native 的 android 状态栏?

我正在尝试使用 react-native 为 android 状态栏设置渐变颜色。但是 setBackgroundColor 正在获取颜色字符串。

状态栏颜色可以使用渐变色吗?

react-native react-native-android

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

BackgroundTaskBuilder.Register中拒绝访问

var builder=new BackgroundTaskBuilder();

builder.Name=name;
builder.TaskEntryPoint=taskEntryPoint;
builder.SetTrigger(trigger);

if(condition!=null)
  builder.AddCondition(condition);

builder.Register(); // in this step I get exception System.UnauthorizedAccessException. Additional information: Access is denied.
Run Code Online (Sandbox Code Playgroud)

此异常在Windows 8发布预览中引发.在消费者预览中,我没有得到这个例外.

我使用SystemTrigger(SystemtriggerType.UserPresent)和SystemCondition(SystemConditionType.InternetAvailable)

在Package.appxmanifest文件中,我将System event复选框设置为true并输入Entry Point值.同样在Package.appxmanifest代码中我删除了'Executable'属性.

也许有人知道如何解决它?

先感谢您!

microsoft-metro windows-8 windows-runtime

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