-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from gokulkrishh/master
Added angular quickcommands
- Loading branch information
Showing
14 changed files
with
469 additions
and
5 deletions.
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
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
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
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 @@ | ||
/*================================================================ | ||
=> App = <%= site_name %> | ||
==================================================================*/ | ||
/*global angular*/ | ||
|
||
'use strict'; | ||
|
||
var app = angular.module('<%= site_name %>', ['ngRoute']); | ||
|
||
app.config(['$routeProvider', function($routeProvider) { | ||
|
||
$routeProvider | ||
.when('', { | ||
controller: '', | ||
templateUrl: '' | ||
}) | ||
|
||
.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,20 @@ | ||
|
||
/*================================================================ | ||
=> Controller = <%= classedName %>Ctrl | ||
==================================================================*/ | ||
/*global app*/ | ||
|
||
app.controller('<%= classedName %>Ctrl', ['$scope', function ($scope) { | ||
|
||
'use strict'; | ||
|
||
|
||
|
||
|
||
console.log('Controller === <%= classedName %>Ctrl'); | ||
}]); | ||
|
||
|
||
/*----- End of Controller = <%= classedName %>Ctrl ------*/ | ||
|
||
|
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,21 @@ | ||
/*================================================================ | ||
=> Directive = <%= cameledName %> | ||
==================================================================*/ | ||
/*global app*/ | ||
|
||
app.directive('<%= cameledName %>', ['$rootScope', function ($rootScope) { | ||
|
||
'use strict'; | ||
|
||
return { | ||
restrict: 'A', | ||
link: function (scope, element, attrs) { | ||
|
||
console.log('Directive === <%= cameledName %>'); | ||
} | ||
}; | ||
|
||
}]); | ||
|
||
|
||
/*----- End of Directive = <%= cameledName %> ------*/ |
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 @@ | ||
/*================================================================ | ||
=> Filter = <%= cameledName %> | ||
==================================================================*/ | ||
/*global app*/ | ||
|
||
app.filter('<%= cameledName %>', function () { | ||
|
||
'use strict'; | ||
|
||
return function (input) { | ||
|
||
console.log('Filter == <%= cameledName %>'); | ||
|
||
return; | ||
}; | ||
}); | ||
|
||
|
||
/*----- End of Filter = <%= cameledName %> ------*/ |
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,51 @@ | ||
|
||
/*================================================================ | ||
=> Service = <%= cameledName %> | ||
==================================================================*/ | ||
/*global app*/ | ||
|
||
app.service('<%= cameledName %>', ['$rootScope', '$q', '$http', function ($rootScope, $q, $http) { | ||
|
||
'use strict'; | ||
|
||
//GET method | ||
this.getUserData = function (url) { | ||
var defer = $q.defer(); | ||
|
||
$http.get(url) | ||
.success(function (data) { | ||
deferred.resolve(data); | ||
}) | ||
.error(function (err) { | ||
deferred.reject(err); | ||
}); | ||
|
||
return deferred.promise; | ||
|
||
}; | ||
|
||
//POST method | ||
this.postUserData = function (userData) { | ||
var defer = $q.defer(); | ||
|
||
var url = ''; //POST url | ||
|
||
$http.post({ | ||
url : url, | ||
data : userData | ||
}) | ||
.success(function (data) { | ||
deferred.resolve(data); | ||
}) | ||
.error(function (err) { | ||
deferred.reject(err); | ||
}); | ||
|
||
return deferred.promise; | ||
|
||
}; | ||
|
||
}]); | ||
|
||
|
||
/*----- End of Service = <%= cameledName %> ------*/ |
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,31 @@ | ||
'use strict'; | ||
var util = require('util'), | ||
chalk = require('chalk'); | ||
|
||
var ScriptBase = require('../script-base.js'); | ||
|
||
|
||
var Generator = module.exports = function Generator() { | ||
ScriptBase.apply(this, arguments); | ||
|
||
// if the controller name is suffixed with ctrl, remove the suffix | ||
// if the controller name is just "ctrl," don't append/remove "ctrl" | ||
if (this.name && this.name.toLowerCase() !== 'ctrl' && this.name.substr(-4).toLowerCase() === 'ctrl') { | ||
this.name = this.name.slice(0, -4); | ||
} | ||
}; | ||
|
||
util.inherits(Generator, ScriptBase); | ||
|
||
//Function to create controller | ||
Generator.prototype.createControllerFiles = function createControllerFiles() { | ||
|
||
this.log(chalk.yellow('Creating controller, please wait...... \n')); | ||
|
||
this.generateSourceAndTest( | ||
'_controller', // controller template name | ||
'spec/controller', //for generating test file in test folder | ||
'controllers', //target dir | ||
this.options['skip-add'] || false | ||
); | ||
}; |
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,23 @@ | ||
'use strict'; | ||
var util = require('util'), | ||
chalk = require('chalk'); | ||
|
||
var ScriptBase = require('../script-base.js'); | ||
|
||
var Generator = module.exports = function Generator() { | ||
ScriptBase.apply(this, arguments); | ||
}; | ||
|
||
util.inherits(Generator, ScriptBase); | ||
|
||
Generator.prototype.createDirectiveFiles = function createDirectiveFiles() { | ||
|
||
this.log(chalk.yellow('Creating directive, please wait...... \n')); | ||
|
||
this.generateSourceAndTest( | ||
'_directive', | ||
'spec/directive', | ||
'directives', | ||
this.options['add-index'] || false | ||
); | ||
}; |
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,23 @@ | ||
'use strict'; | ||
var util = require('util'), | ||
chalk = require('chalk'); | ||
|
||
var ScriptBase = require('../script-base.js'); | ||
|
||
var Generator = module.exports = function Generator() { | ||
ScriptBase.apply(this, arguments); | ||
}; | ||
|
||
util.inherits(Generator, ScriptBase); | ||
|
||
Generator.prototype.createFilterFiles = function createFilterFiles() { | ||
|
||
this.log(chalk.yellow('Creating filter, please wait...... \n')); | ||
|
||
this.generateSourceAndTest( | ||
'_filter', | ||
'spec/filter', | ||
'filters', | ||
this.options['add-index'] || false | ||
); | ||
}; |
Oops, something went wrong.