Skip to content

Instantly share code, notes, and snippets.

@ckentq
Created August 31, 2013 16:45
Show Gist options
  • Save ckentq/6399349 to your computer and use it in GitHub Desktop.
Save ckentq/6399349 to your computer and use it in GitHub Desktop.
var pageChange = function(pageName){
$timeout(function(){
console.log("inTimeout");
app=function(){
console.log("not in Timeout");
$rootScope.$broadcast("pageChanged",pageName);
};
app();
},1000);
}
return {
pageName:function(newPage) { //換分頁發出
if(newPage){//page name = string or none
pageName= newPage;
pageChange(newPage);
}else{
return pageName;
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment