Skip to content

Commit

Permalink
fix provider generator to generate a provider
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinspecker committed Jul 23, 2014
1 parent f1c2cc6 commit a9b2005
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Produces `src/module/bacon-provider.js`:
```javascript
'use strict';

angular.module('module').factory('bacon', function () {
angular.module('module').provider('bacon', function () {
return {
$get: function () {
return 'bacon';
Expand All @@ -413,7 +413,7 @@ describe('bacon', function () {
}));

it('should equal bacon', function () {
expect(provider.$get()).toEqual('bacon');
expect(provider).toEqual('bacon');
});

});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-ng-poly",
"version": "0.0.7",
"version": "0.0.8",
"description": "Yeoman generator for AngularJS and Polymer apps. A work in progress.",
"license": "MIT",
"main": "app/index.js",
Expand Down
2 changes: 1 addition & 1 deletion provider/templates/_provider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

angular.module('<% if (parentModuleName) { %><%= parentModuleName %>.<% } %><%= moduleName %>').factory('<%= lowerCamel %>', function () {
angular.module('<% if (parentModuleName) { %><%= parentModuleName %>.<% } %><%= moduleName %>').provider('<%= lowerCamel %>', function () {
return {
$get: function () {
return '<%= lowerCamel %>';
Expand Down
2 changes: 1 addition & 1 deletion provider/templates/_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ describe '<%= lowerCamel %>', ->
provider = <%= lowerCamel %>

it 'should equal <%= lowerCamel %>', ->
expect(provider.$get()).toEqual '<%= lowerCamel %>'
expect(provider).toEqual '<%= lowerCamel %>'
2 changes: 1 addition & 1 deletion provider/templates/_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('<%= lowerCamel %>', function () {
}));

it('should equal <%= lowerCamel %>', function () {
expect(provider.$get()).toEqual('<%= lowerCamel %>');
expect(provider).toEqual('<%= lowerCamel %>');
});

});

0 comments on commit a9b2005

Please sign in to comment.