forked from yeoman/generator-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copying javascript files to typescript directory.
- Loading branch information
Jacob Eggers
committed
Jan 7, 2014
1 parent
6638dd8
commit c494011
Showing
15 changed files
with
188 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.coffee | ||
*.coffee | ||
*.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>', [<%= angularModules %>])<% if (ngRoute) { %> | ||
.config(function ($routeProvider) { | ||
$routeProvider | ||
.when('/', { | ||
templateUrl: 'views/main.html', | ||
controller: 'MainCtrl' | ||
}) | ||
.otherwise({ | ||
redirectTo: '/' | ||
}); | ||
})<% } %>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.controller('<%= classedName %>Ctrl', function ($scope) { | ||
$scope.awesomeThings = [ | ||
'HTML5 Boilerplate', | ||
'AngularJS', | ||
'Karma' | ||
]; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.config(function ($provide) { | ||
$provide.decorator('<%= cameledName %>', function ($delegate) { | ||
// decorate the $delegate | ||
return $delegate; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.directive('<%= cameledName %>', function () { | ||
return { | ||
template: '<div></div>', | ||
restrict: 'E', | ||
link: function postLink(scope, element, attrs) { | ||
element.text('this is the <%= cameledName %> directive'); | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.filter('<%= cameledName %>', function () { | ||
return function (input) { | ||
return '<%= cameledName %> filter: ' + input; | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.constant('<%= cameledName %>', 42); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.factory('<%= cameledName %>', function () { | ||
// Service logic | ||
// ... | ||
|
||
var meaningOfLife = 42; | ||
|
||
// Public API here | ||
return { | ||
someMethod: function () { | ||
return meaningOfLife; | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.provider('<%= cameledName %>', function () { | ||
|
||
// Private variables | ||
var salutation = 'Hello'; | ||
|
||
// Private constructor | ||
function Greeter() { | ||
this.greet = function () { | ||
return salutation; | ||
}; | ||
} | ||
|
||
// Public API for configuration | ||
this.setSalutation = function (s) { | ||
salutation = s; | ||
}; | ||
|
||
// Method for instantiating | ||
this.$get = function () { | ||
return new Greeter(); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.service('<%= classedName %>', function <%= classedName %>() { | ||
// AngularJS will instantiate a singleton by calling "new" on this function | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
'use strict'; | ||
|
||
angular.module('<%= scriptAppName %>') | ||
.value('<%= cameledName %>', 42); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
describe('Controller: <%= classedName %>Ctrl', function () { | ||
|
||
// load the controller's module | ||
beforeEach(module('<%= scriptAppName %>')); | ||
|
||
var <%= classedName %>Ctrl, | ||
scope; | ||
|
||
// Initialize the controller and a mock scope | ||
beforeEach(inject(function ($controller, $rootScope) { | ||
scope = $rootScope.$new(); | ||
<%= classedName %>Ctrl = $controller('<%= classedName %>Ctrl', { | ||
$scope: scope | ||
}); | ||
})); | ||
|
||
it('should attach a list of awesomeThings to the scope', function () { | ||
expect(scope.awesomeThings.length).toBe(3); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
describe('Directive: <%= cameledName %>', function () { | ||
|
||
// load the directive's module | ||
beforeEach(module('<%= scriptAppName %>')); | ||
|
||
var element, | ||
scope; | ||
|
||
beforeEach(inject(function ($rootScope) { | ||
scope = $rootScope.$new(); | ||
})); | ||
|
||
it('should make hidden element visible', inject(function ($compile) { | ||
element = angular.element('<<%= _.dasherize(name) %>></<%= _.dasherize(name) %>>'); | ||
element = $compile(element)(scope); | ||
expect(element.text()).toBe('this is the <%= cameledName %> directive'); | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
'use strict'; | ||
|
||
describe('Filter: <%= cameledName %>', function () { | ||
|
||
// load the filter's module | ||
beforeEach(module('<%= scriptAppName %>')); | ||
|
||
// initialize a new instance of the filter before each test | ||
var <%= cameledName %>; | ||
beforeEach(inject(function ($filter) { | ||
<%= cameledName %> = $filter('<%= cameledName %>'); | ||
})); | ||
|
||
it('should return the input prefixed with "<%= cameledName %> filter:"', function () { | ||
var text = 'angularjs'; | ||
expect(<%= cameledName %>(text)).toBe('<%= cameledName %> filter: ' + text); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
describe('Service: <%= cameledName %>', function () { | ||
|
||
// load the service's module | ||
beforeEach(module('<%= scriptAppName %>')); | ||
|
||
// instantiate service | ||
var <%= cameledName %>; | ||
beforeEach(inject(function (_<%= cameledName %>_) { | ||
<%= cameledName %> = _<%= cameledName %>_; | ||
})); | ||
|
||
it('should do something', function () { | ||
expect(!!<%= cameledName %>).toBe(true); | ||
}); | ||
|
||
}); |