小编Dev*_*oop的帖子

将chrome扩展与phantomjs集成

有没有办法可以用phantomjs安装chrome扩展名(.crx)?

我的任务是将adblockplus与phantomjs 集成,以便我可以使用phantomjs过滤所有广告和报告.

或者将adblockplus扩展与phantomjs 集成的任何其他方式?

adblock google-chrome-extension phantomjs

11
推荐指数
1
解决办法
4122
查看次数

AngularUI Router:在调用子状态时将url params传递给'abstract'状态

我想在调用子状态时访问抽象状态中的url参数($ stateParam).我很想知道如何做到这一点.plunker中的代码也是

$stateProvider
    .state('contacts', {
        abstract: true,

        //my whole point is to get the id=1 here :(

        url: '/contacts/:id',
        templateUrl: function($stateParams){
            console.log("Did i get the child's parameter here? " + $stateParams.id)
            return 'contacts' + $stateParams.id + '.html'; //this will have a ui-view in it which will render its detail.
        }
    })

    .state('contacts.detail', {
        url: '/:id',
        // loaded into ui-view of parent's template
        templateUrl: 'contacts.detail.html',
        controller: function($scope, $stateParams){
          $scope.person = $scope.contacts[$stateParams.id];
        },
        onEnter: function(){
          console.log("enter contacts.detail");
        }
    }) …
Run Code Online (Sandbox Code Playgroud)

angularjs angular-ui angular-ui-bootstrap angular-ui-router

9
推荐指数
1
解决办法
4701
查看次数

'halt' (Plug.Conn.halt/1) 在控制器重定向后不会停止调用链

我在基于某些逻辑的控制器中有一个“halt/1”,但不是在插头中。可悲的是,它确实重定向,但也在重定向后运行代码。

if true do
  conn
    |> put_flash(:error, "Sorry, entered wrong")
    |> redirect(to: route_path(conn, :show, model))
    |> halt #this does not work :(
else
   _ #something
end

update_another_model() #this is executed
render(conn, "abc.html", model: model) #even this is executed
Run Code Online (Sandbox Code Playgroud)

我实际上需要在重定向后终止调用,有什么想法吗?

redirect elixir phoenix-framework

5
推荐指数
1
解决办法
2158
查看次数