Skip to content

Commit

Permalink
Rename getInstance to createInstance
Browse files Browse the repository at this point in the history
Don't ask me why the name was getInstance in the first place 😕
  • Loading branch information
victorb committed Jul 15, 2015
1 parent f888e28 commit af3c225
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build/ngProgress.js
Expand Up @@ -174,7 +174,7 @@ angular.module('ngProgress.provider', ['ngProgress.directive'])
})
.factory('ngProgressFactory', function($injector, ngProgress) {
var service = {
getInstance: function () {
createInstance: function () {
return $injector.instantiate(ngProgress);
}
};
Expand Down
2 changes: 1 addition & 1 deletion build/ngProgress.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions index.html
Expand Up @@ -192,7 +192,7 @@ <h3>Usage</h3>
<p>
Create a new instance of ngProgress and start showing the progress of things!
<pre>
$scope.progressbar = ngProgressFactory.getInstance();
$scope.progressbar = ngProgressFactory.createInstance();
$scope.progressbar.start();
</pre>
</p>
Expand Down Expand Up @@ -272,7 +272,7 @@ <h2>Share</h2>
<h2>
API
</h2>
<pre>ngProgressFactory.getInstance()</pre>
<pre>ngProgressFactory.createInstance()</pre>
<p>REQUIRED TO USE! Creates a new instance of ngProgress that you can use the methods below with.</p>
<pre>ngProgress.start();</pre>
<p>Starts the animation and adds between 0 - 5 percent to the loading percentage every 400 milliseconds. Should always be finished with progressbar.complete() to hide it.</p>
Expand Down Expand Up @@ -339,12 +339,12 @@ <h2>License</h2>
$scope.name = 'Lars';
$scope.show = false;

$scope.progressbar = ngProgressFactory.getInstance();
$scope.progressbar = ngProgressFactory.createInstance();

$scope.color = 'firebrick';
$scope.height = '3px';

$scope.contained_progressbar = ngProgressFactory.getInstance();
$scope.contained_progressbar = ngProgressFactory.createInstance();
$scope.contained_progressbar.setParent(document.getElementById('demo_contained'));
$scope.contained_progressbar.setAbsolute();

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -41,7 +41,7 @@ var MainCtrl = function($scope, $timeout, ngProgressFactory) {}
Create a instance of the progressbar

```javascript
$scope.progressbar = ngProgressFactory.getInstance();
$scope.progressbar = ngProgressFactory.createInstance();
```

Use with the API down below
Expand Down
2 changes: 1 addition & 1 deletion src/provider.js
Expand Up @@ -168,7 +168,7 @@ angular.module('ngProgress.provider', ['ngProgress.directive'])
})
.factory('ngProgressFactory', function($injector, ngProgress) {
var service = {
getInstance: function () {
createInstance: function () {
return $injector.instantiate(ngProgress);
}
};
Expand Down
6 changes: 3 additions & 3 deletions tests/ngProgressProviderSpec.js
Expand Up @@ -6,7 +6,7 @@ describe('How the provider should work', function () {
});

beforeEach(inject(function (ngProgressFactory, $window) {
this.progressbar = ngProgressFactory.getInstance();
this.progressbar = ngProgressFactory.createInstance();
this.$window = $window;
}));

Expand Down Expand Up @@ -140,7 +140,7 @@ describe('How the provider should work', function () {
waits(200);
runs(function () { expect([6, this.progressbar.status()]).toEqual([6, 100]); });
});

it('allow you to change the parent of the progressbar', function () {
var domElement = this.progressbar.getDomElement()[0];
expect(domElement.parentNode).toEqual(document.body);
Expand All @@ -150,7 +150,7 @@ describe('How the provider should work', function () {
this.progressbar.setParent(div);
expect(domElement.parentNode).toEqual(div);
});

it('throws exception when invalid parent is set', function () {
var that = this;
expect(function () {
Expand Down

0 comments on commit af3c225

Please sign in to comment.