我是新来的反应。我正在跟踪一个视频教程,并被卡在这一点上的request.js文件。.// if [movies], it runs everytime when the movie changes. a row has lots of movies asyncfunction fetchData(){
const request = await axios.get(fetchUrl) //aw
我注意到,在我更改了异步函数中绑定到视图的任何属性后,视图不会用当前值更新,因此每次我都必须在函数的末尾调用$scope.$apply()。异步代码示例: await this.$apply(); <-- would like to omit this在此之后,新的text值将不会显示在视图中。
有没有什么变通办法,让我不必每次都手动调用$scope.