小编bru*_*lin的帖子

从其他机器访问localhost-Angular

背景

大多数开发人员在处理项目时经常使用两个或多个台式机和笔记本电脑。和我一样,现在我正在从事Angular项目。

目标

我想从正在使用的另一台计算机上访问localhost:4200,以便可以在不切换一台计算机上的窗口的情况下检查UI更新。

我进行了一些研究,并尝试使用以下angular-cli命令。

ng serve --host=MyLocalIP
ng serve --host 0.0.0.0
Run Code Online (Sandbox Code Playgroud)

但是到目前为止还没有运气。有没有更好的方法来实现这一目标?

localhost connect angular

6
推荐指数
2
解决办法
3934
查看次数

axios 完成事件

我正在使用 Axios 进行 API 服务,只是好奇是否有任何官方方法来处理我们在 Ajax 调用中使用的“完整”事件。

所以喜欢

axios.get('/v1/api_endpoint?parameters')
  .then((res) => { .. })
  .catch((err) => { .. })
  .complete(() => {})     //  <== is there any way to handle this complete event? 
Run Code Online (Sandbox Code Playgroud)

javascript axios

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

Angular 6中输入和跨度之间的文本绑定

如何在Angular6中绑定输入文本以跨越innerHTML?

ts文件

...
finance_fullname: string;
...
Run Code Online (Sandbox Code Playgroud)

模板文件

<input type="text" id="finance_fullname" [(ngModel)]="finance_fullname">
<span class="fullname" ngBind="finance_fullname"></span>
Run Code Online (Sandbox Code Playgroud)

data-binding angular angular6

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