Skip to content

Commit

Permalink
Completed first version of Debounce documentation #39
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizzamia committed Dec 8, 2014
1 parent 639bb08 commit ea4c230
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ angular.module('myApp.controllers', [])
$timeout(function () {
Rainbow.color();
});

})
.directive('ngScroll', function($timeout) {
return function(scope, element, attrs) {
Expand All @@ -359,7 +358,15 @@ angular.module('myApp.controllers', [])
});
};
})
.controller('DebounceCtrl', function($scope) {
.controller('DebounceCtrl', function($rootScope, $scope, $timeout, debounce) {
$rootScope.page = 'debounce';
$scope.number = 1;
$scope.plusOne = debounce(function () {
$scope.number += 1;
}, 1000);
$timeout(function () {
Rainbow.color();
});
})
.controller('WebSocketCtrl', function($scope, WebSocket) {
$scope.tag = 'angularjs';
Expand Down
31 changes: 31 additions & 0 deletions docs/template/service/debounce.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
<%= include ../title-inside.html %>
<div class="page-header">
<h2>Debounce <small>(ngTasty.service.debounce)</small></h2>
<p></p>
</div>

<div class="row">
<div class="col-md-12 docs-head">
<p>An Angular Service for limits the rate at which a function can fire</p>
</div>
<div class="col-xs-12">
<button class="btn btn-info btn-lg" ng-click="plusOne()">Plus One</button>
<h2 ng-bind="number"></h2>
</div>
<div class="col-xs-12">
<tabset class="code">
<tab heading="Markup">
<div>
<pre ng-non-bindable><code data-language="html">&lt;button class="btn btn-info btn-lg" ng-click="plusOne()"&gt;Plus One&lt;/button&gt;
&lt;h2 ng-bind="number"&gt;&lt;/h2&gt;</code></pre>
</div>
</tab>
<tab heading="JavaScript">
<div>
<pre ng-non-bindable><code data-language="javascript">.controller('MyCtrl', function($scope, debounce) {
$scope.number = 1;
$scope.plusOne = debounce(function () {
$scope.number += 1;
}, 1000);
})</code></pre>
</div>
</tab>
</tabset>
</div>
</div>
1 change: 1 addition & 0 deletions docs/template/service/join-objects.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%= include ../title-inside.html %>
<div class="page-header">
<h2>Join Objects <small>(ngTasty.service.joinObjects)</small></h2>
<p></p>
Expand Down
1 change: 1 addition & 0 deletions docs/template/service/set-property.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%= include ../title-inside.html %>
<div class="page-header">
<h2>Set Property <small>(ngTasty.service.setProperty)</small></h2>
<p></p>
Expand Down

0 comments on commit ea4c230

Please sign in to comment.