Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-cg-angular",
"version": "3.2.0",
"version": "3.2.1",
"description": "Yeoman Generator for Enterprise Angular projects.",
"keywords": [
"yeoman-generator",
Expand Down
13 changes: 11 additions & 2 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,17 @@ exports.addNamePrompt = function(that,prompts,type){
prompts.splice(0,0,{
name:'name',
message: 'Enter a name for the ' + type + '.',
validate: function(input){
return true;
validate: function(input) {
var valid = false;
switch (type) {
case 'directive': //https://github.com/angular/angular.js/commit/634e467172efa696eb32ef8942ffbedeecbd030e
valid = (input === input.trim()) && (input[0].toLowerCase() === input[0]);
break;
default:
valid = true;
}

return valid;
}
});
}
Expand Down