【发布时间】:2025-12-23 22:20:10
【问题描述】:
我是 AngularJS 的新手,我正在尝试从电影列表中进行详细视图,当您从“主页”视图中选择一部电影(单击标题)时,它应该将您重定向到新的查看所选电影的详细信息,但我不知道该怎么做。我看了很多教程,但对我有用,希望你能帮助我,谢谢!!
这里是部分代码:http://jsfiddle.net/3fu0gr81/
这是我的 json 文件的示例:
[{ "Title": "Birdman",
"Plot": "A washed-up actor, who once played an iconic superhero, battles his ego and attempts to recover his family, his career and himself in the days leading up to the opening of his Broadway play.",
"Year": "2014",
"Director": "Alejandro González Iñárritu",
"Genre": "Comedy",
"Duration": "119 min",
}]
【问题讨论】:
-
为什么不在movieDetail控制器中调用工厂而不在controller1中调用工厂
-
谢谢,我会解决这个问题,但我的问题还没有解决
-
您可以创建一个服务并使用该服务在控制器之间传递数据
标签: angularjs model-view-controller routing views ng-view