Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在Http.get()之后显示模式窗口_Html_Angular_Bootstrap Modal_Angular Ui Bootstrap - Fatal编程技术网

Html 在Http.get()之后显示模式窗口

Html 在Http.get()之后显示模式窗口,html,angular,bootstrap-modal,angular-ui-bootstrap,Html,Angular,Bootstrap Modal,Angular Ui Bootstrap,我正在调用一个函数以从Http.get()请求获取响应 我的数据检索功能如下: getCharacterDetail(characterId: number) { return this.http.get(this.characterDetailApiUrl + characterId) .subscribe(res => console.log(res.json()) ); } 现在我必须将这些数据显示到一个模式窗口中。不

我正在调用一个函数以从Http.get()请求获取响应

我的数据检索功能如下:

getCharacterDetail(characterId: number) {
    return this.http.get(this.characterDetailApiUrl + characterId)
        .subscribe(res =>
            console.log(res.json())
        );
}

现在我必须将这些数据显示到一个模式窗口中。不知道该做什么。

使用您提供的代码,这里粗略估计了您可能要查找的内容

app.controller('characterController', function ($scope, $http) {
  $scope.getCharacterDetail = function (number) {
     return $http.get(this.characterDetailApiUrl + characterId)
       .subscribe(res =>
           console.log(res.json())
       );
     }
});

使用您提供的代码,这里粗略估计了您可能要查找的内容

app.controller('characterController', function ($scope, $http) {
  $scope.getCharacterDetail = function (number) {
     return $http.get(this.characterDetailApiUrl + characterId)
       .subscribe(res =>
           console.log(res.json())
       );
     }
});

ng bootrstrap是一个很好的选择,因为模态组件是可用的,您可以将必要的数据作为输入传递给组件


ng bootrstrap将是一个不错的选择,因为模态组件是可用的,您可以将必要的数据作为输入传递给组件


您的dom看起来怎么样?材质对话框?bootstrap modal?对不起,我用的是bootstrap 3,所以,是的,我会用bootstrap modalI,我个人觉得这个解决方案不太干净,所以我改用角材料。但是如果你想用带角度的引导模式。这是你能做的。参考资料:嗯,我也可以使用角材料。没有问题想一想你想做什么,然后去做。我不是说materiala.angular.io更好。我只是想尝试一下,学习一下。这是一个非常新的组件,所以它们没有很多像bootstrap这样的组件?材质对话框?bootstrap modal?对不起,我用的是bootstrap 3,所以,是的,我会用bootstrap modalI,我个人觉得这个解决方案不太干净,所以我改用角材料。但是如果你想用带角度的引导模式。这是你能做的。参考资料:嗯,我也可以使用角材料。没有问题想一想你想做什么,然后去做。我不是说materiala.angular.io更好。我只是想尝试一下,学习一下。这是非常新的,所以他们没有很多像bootstrap这样的组件。最后,我将使用ng bootstrap,但我不知道如何在我的app.component.ts中实现:(如何使用Typescript中的多个组件并在它们之间建立关系最终我将使用ng引导,但不知道如何在我的app.component.ts中实现。)(如何使用Typescript中的多个组件并在它们之间建立关系