当您从 index.html#/admin/authors/1/edit 转换到 index.html#/admin/authors/2/edit 时,不会调用路由上的 deactivate 。
当您从 index.html#/admin/authors/1/edit 转换到 index.html#/admin/authors/new 时,调用deactivate 路由。
我希望在这两种情况下都调用 deactivate ?
在路由级别是否有另一种方法来检测您从 ../1/edit 切换到 ../2/edit ?
我需要在主详细信息视图中使用它(主是所有作者的列表,详细信息是每个作者属性的文本字段形式)。如果用户在列表中选择了另一个作者并且之前的作者被修改而没有保存,我需要回滚事务或询问用户“你要保存更改吗?”。