Init the Angular app as soon as possible.
parent
6d34639f15
commit
67f1fd41c3
|
@ -1,3 +1,3 @@
|
|||
|
||||
var snipt={module:function(){var modules={};return function(name){if(modules[name]){return modules[name];}
|
||||
return modules[name]={};};}()};jQuery(function($){var SiteView=snipt.module('site').SiteView;window.site=new SiteView();});(function(){if(typeof angular!=='undefined'){var root=this;var app=angular.module('Snipt',[],function($locationProvider){$locationProvider.html5Mode(true);});app.config(function($interpolateProvider){$interpolateProvider.startSymbol('((');$interpolateProvider.endSymbol('))');});root.app=app;}}).call(this);
|
||||
return modules[name]={};};}()};jQuery(function($){var SiteView=snipt.module('site').SiteView;window.site=new SiteView();});(function(){var root=this;var app=angular.module('Snipt',[],function($locationProvider){$locationProvider.html5Mode(true);});app.config(function($interpolateProvider){$interpolateProvider.startSymbol('((');$interpolateProvider.endSymbol('))');});root.app=app;}).call(this);
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
(function(){if(typeof angular!=='undefined'){var root=this;var $=root.jQuery;var controllers={};var app=root.app;app.factory('SearchService',function(){return{mineOnly:false,query:''};});controllers.HeaderSearchController=function($scope,SearchService){$scope.search=SearchService;};controllers.SearchController=function($scope,SearchService){$scope.search=SearchService;$scope.$watch('search.query',function(query){if(query.indexOf('--mine')!==-1){$scope.search.mineOnly=true;}else{$scope.search.mineOnly=false;}});$scope.toggleMineOnly=function(){if($scope.search.mineOnly){if($scope.search.query.indexOf('--mine')===-1){$scope.search.query=$scope.search.query.trim()+' --mine';}}
|
||||
else{$scope.search.query=$scope.search.query.replace('--mine','').trim();}};};app.controller(controllers);}}).call(this);
|
Loading…
Reference in New Issue