Skip to content

Instantly share code, notes, and snippets.

angular
.module('proj')
.config(config);
/** @ngInject */
function config($logProvider, $httpProvider) {
// Enable log
$logProvider.debugEnabled(true);
// set default headers
$rootScope.$on('stateChangeError', function(e) {
if (e typeof AuthError) {
$state.go('login');
}
}
angular-seed
ui-router-extras
angular-permission
//increase performance when making list of one time requests
$httpProvider.useApplyAsync()
$templateRequest
//chrome element scope debug
(function() {
'use strict';
angular
.module('uaMain')
.directive('essaysEdit', essaysEdit);
/** @ngInject */
function essaysEdit($sce) {
var directive = {
@kis
kis / modal form
Created September 9, 2015 09:06
form
<form class="form-horizontal" name="videoForm" ng-submit="saveVideo()" novalidate>
<div class="modal-header">
<h3 class="modal-title">Add Video</h3>
</div>
<div class="modal-body">
<div class="form-group">
<label class="col-sm-4 control-label">Video Title</label>
<div class="col-sm-6">
<input type="text" ng-model="video.title" class="form-control" placeholder="Video Title" required>
@kis
kis / modal service
Created September 9, 2015 12:56
modal service
(function() {
'use strict';
angular
.module('uaMain')
.factory('collegeModalService', collegeModalService);
/** @ngInject */
function collegeModalService($http, $modal, URL, collegeService) {
return {
@kis
kis / modal instance
Created September 9, 2015 12:56
modal instance
$scope.openModal = function(video) {
var modalInstance = addVideoService.openAddVideoModal(video);
return modalInstance.result;
};
$scope.addVideo = function() {
$scope.openModal(null).then(function(data) {
data.date_created = new Date();
$scope.profile.videos.unshift(data);
});
@kis
kis / index.run.js
Created September 9, 2015 12:57
run block
(function() {
'use strict';
angular
.module('uaMain')
.run(runBlock);
/** @ngInject */
function runBlock($rootScope, $log, $state, bootstrap3ElementModifier, defaultErrorMessageResolver, validator, editableOptions) {
// Set $state visible for all scopes
@kis
kis / apache
Created September 11, 2015 11:28
How to setup project locally
1. Clone project from github: git clone git@github.com:boo1ean/network.git
2. Go to project dir and run: ./composer.phar install
3. Set rw permissions for runtime folders: chmod 777 -R public/assets/ app/runtime/
4. Add new site record to apache conf sudo gedit /etc/apache2/sites-available/network (will create new file if doesn't exist) And put:
TypeScript enhances JavaScript with types, classes and interfaces. Some people think that is the problem with JavaScript. It’s not. The problem with JavaScript is not that it is a dynamically typed prototype based object-oriented language without classes. That is actually JavaScript’s strength. The problem is that it is a poorly designed language, filled with many hidden land mines awaiting the unsuspecting developer.