Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
/*
 AngularJS v1.0.8
 (c) 2010-2012 Google, Inc. http://angularjs.org
 License: MIT
*/
(function(n,j){'use strict';j.module("bootstrap",[]).directive({dropdownToggle:["$document","$location","$window",function(g,d){var e=null,a;return{restrict:"C",link:function(h,b){h.$watch(function(){return d.path()},function(){a&&a()});b.parent().bind("click",function(){a&&a()});b.bind("click",function(i){i.preventDefault();i.stopPropagation();i=!1;e&&(i=e===b,a());i||(b.parent().addClass("open"),e=b,a=function(c){c&&c.preventDefault();c&&c.stopPropagation();g.unbind("click",a);b.parent().removeClass("open");
e=a=null},g.bind("click",a))})}}}],tabbable:function(){return{restrict:"C",compile:function(g){var d=j.element('<ul class="nav nav-tabs"></ul>'),e=j.element('<div class="tab-content"></div>');e.append(g.contents());g.append(d).append(e)},controller:["$scope","$element",function(g,d){var e=d.contents().eq(0),a=d.controller("ngModel")||{},h=[],b;a.$render=function(){var a=this.$viewValue;if(b?b.value!=a:a)if(b&&(b.paneElement.removeClass("active"),b.tabElement.removeClass("active"),b=null),a){for(var c=
0,d=h.length;c<d;c++)if(a==h[c].value){b=h[c];break}b&&(b.paneElement.addClass("active"),b.tabElement.addClass("active"))}};this.addPane=function(d,c){function l(){f.title=c.title;f.value=c.value||c.title;if(!a.$setViewValue&&(!a.$viewValue||f==b))a.$viewValue=f.value;a.$render()}var k=j.element("<li><a href></a></li>"),m=k.find("a"),f={paneElement:d,paneAttrs:c,tabElement:k};h.push(f);c.$observe("value",l)();c.$observe("title",function(){l();m.text(f.title)})();e.append(k);k.bind("click",function(b){b.preventDefault();
b.stopPropagation();a.$setViewValue?g.$apply(function(){a.$setViewValue(f.value);a.$render()}):(a.$viewValue=f.value,a.$render())});return function(){f.tabElement.remove();for(var a=0,b=h.length;a<b;a++)f==h[a]&&h.splice(a,1)}}}]}},table:function(){return{restrict:"E",link:function(g,d){d[0].className="table table-bordered table-striped code-table"}}},tabPane:function(){return{require:"^tabbable",restrict:"C",link:function(g,d,e,a){d.bind("$remove",a.addPane(d,e))}}}})})(window,window.angular);
New to GrepCode? Check out our FAQ X