小编Jam*_*dla的帖子

仅在安装时通过WhatsApp共享

我正在尝试为安装了该应用的访问者提供WhatsApp共享选项(针对移动网站).

验证访问者是否能够使用此功能的最佳方法是什么,以便我可以相应地启用/禁用它?

该功能只是使用自定义URL方案的链接:

<a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>

javascript whatsapp

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

从父路径到子路径传递路径参数

我的路线结构如下:

parent/:id
    |
    child
    |
    child
Run Code Online (Sandbox Code Playgroud)

我可以通过以下方式从父组件获取参数:

ngOnInit() {
  this.route.params.subscribe((params) => {
      this.id = +params['id'];
  });
}
Run Code Online (Sandbox Code Playgroud)

然后<router-output>以某种方式将其作为输入?还是我必须像处理父母一样从每个孩子那里提取价值?

将参数从父组件传递到所有子组件的最佳方法是什么id

angular2-routing angular

4
推荐指数
3
解决办法
2249
查看次数

在无序列表中控制子弹后的空间

是否有任何方法可以将文章放入ul中的子弹后更远?

我能想到的唯一方法是制作一个自定义子弹图像并更改填充,但我希望有一个更简单的分辨率.

html css

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

三元运算符不工作

Netbeans说我的三元运算符不是声明.怎么会?

int direction;
direction = (Math.random() < 0.5) ? 0 : 1; // direction is either L or R (0 or 1)
direction == 0 ? System.out.print('L') : System.out.print('R');
Run Code Online (Sandbox Code Playgroud)

我试过它是if/then/else对应的并且它工作正常:

int direction;
direction = (Math.random() < 0.5) ? 0 : 1; // direction is either L or R (0 or 1)
if(direction == 0){
    System.out.print('L');
} else {
    System.out.print('R');
}
Run Code Online (Sandbox Code Playgroud)

java ternary-operator

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