Skip to content

Instantly share code, notes, and snippets.

@psdcoder
Created February 20, 2015 12:20
Show Gist options
  • Select an option

  • Save psdcoder/e5a00ba81372a1adecc2 to your computer and use it in GitHub Desktop.

Select an option

Save psdcoder/e5a00ba81372a1adecc2 to your computer and use it in GitHub Desktop.
Angular webstorm live templates
(function () {
'use strict';
angular
.module('$MODULE_NAME$')
.config($COMPONENT$Initialization);
function $COMPONENT$Initialization() {
$END$
}
})();
(function () {
'use strict';
angular
.module('$MODULE_NAME$')
.controller('$CONTROLLER_NAME$Ctrl', $CONTROLLER_NAME$Ctrl);
function $CONTROLLER_NAME$Ctrl() {
var vm = this;
$END$
}
})();
(function () {
'use strict';
angular
.module('$MODULE_NAME$')
.directive('$DIRECTIVE_NAME$', $DIRECTIVE_NAME$Directive);
function $DIRECTIVE_NAME$Directive() {
return {
restrict: 'EA',
replace: true,
link: function ($scope, $element, $attrs) {
$END$
}
};
}
})();
(function () {
'use strict';
angular
.module('$MODULE_NAME$')
.factory('$SERVICE_NAME$', $SERVICE_NAME$);
function $SERVICE_NAME$() {
return $END$;
}
})();
(function () {
'use strict';
angular
.module('$MODULE_NAME$')
.filter('$FILTER_NAME$', $FILTER_NAME$Filter);
function $FILTER_NAME$Filter() {
return function ($ARGS$) {
$END$;
};
}
})();
(function () {
'use strict';
angular
.module('$MODULE_NAME$')
.factory('$MODEL_NAME$Model', $MODEL_NAME$Model);
function $MODEL_NAME$Model(ConfigModel, $resource) {
return $resource(
ModelsConfig.api() + '$MODEL_NAME$/:id:method',
{
id: '@id'
},
{
update: {
method: 'PUT'
}$END$
}
);
}
})();
(function () {
'use strict';
angular.module('$MODULE_NAME$', [$DEPS$]);
})();
(function () {
'use strict';
angular
.module('$MODULE_NAME$')
.provider('$PROVIDER_NAME$', $PROVIDER_NAME$);
function $PROVIDER_NAME$() {
this.$get = $PROVIDER_NAME$Factory;
function $PROVIDER_NAME$Factory() {
return {};
}
}
})();
(function () {
'use strict';
angular
.module('$MODULE_NAME$')
.config($NAME$RoutesConfiguration);
function $NAME$RoutesConfiguration($stateProvider) {
$stateProvider
.state('$NAME$', {
url: '$URL$',
views: {
'$VIEW_NAME$': {
templateUrl: '$TEMPLATE_URL$'
}
}
});
}
})();
(function () {
'use strict';
angular
.module('$MODULE_NAME$')
.service('$SERVICE_NAME$', $SERVICE_NAME$);
function $SERVICE_NAME$() {
$END$
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment