有没有办法可以用phantomjs安装chrome扩展名(.crx)?
我的任务是将adblockplus与phantomjs 集成,以便我可以使用phantomjs过滤所有广告和报告.
或者将adblockplus扩展与phantomjs 集成的任何其他方式?
我想在调用子状态时访问抽象状态中的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) 我在基于某些逻辑的控制器中有一个“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)
我实际上需要在重定向后终止调用,有什么想法吗?