Angular2 CanDeactivate with directive而不是component

时间:2017-05-16 22:12:38

标签: angular angular-router-guards

是否可以将# server.R library(shiny) library(plotly) shinyServer(function(input, output) { output$surface <- renderPlotly({ p <- plot_ly(z = ~volcano, type = "surface") layout(p,scene=list(camera=list(up=list(x=0,y=0,z=1), center=list(x=0,y=0,z=0), eye=list(x=1.25*sin(input$deg*(pi/180)), y=1.25*cos(input$deg*(pi/180)), z=1.25) ))) }) }) 与指令一起使用而不是组件?

我的实现如下所示,但不起作用:

CanDeactivate

我的路由器:

class CanDeactivateTeam implements CanDeactivate<SomeDirective> {

    canDeactivate(
        directive: SomeDirective,
        currentRoute: ActivatedRouteSnapshot,
        currentState: RouterStateSnapshot,
        nextState: RouterStateSnapshot
      ): Observable<boolean>|Promise<boolean>|boolean {

        return directive.doChecks();
      }
}

0 个答案:

没有答案