【发布时间】:2015-01-16 08:09:15
【问题描述】:
我有一个基本的 Angular 应用程序,它列出了一天中的事件。用户可以通过单击日历(angular-ui-calendar)来更改日期。在我的控制器中,我有一个 Date 类型的模型对象“selectedDay”。
目前应用的网址是: http://localhost/app#/daypicker
我已将 ngroute 配置为也接受以下形式的 url http://localhost/app#/daypicker/2015-02-15
这很好用,但我希望在用户单击日历时更新 url 并匹配我的模型对象。
因此,如果用户在日历中单击 3 月 1 日,我希望使用这个新日期更新 url。 (http://localhost/app#/daypicker/2015-03-01)
这可以通过 ngroute 完成还是我需要使用其他插件?
【问题讨论】: