- Нужно всегда делать в начале файла var name_some_module = require('some_module') и уже потом использовать его. Каждый require синхронный и, очевидно, блочит весь процесс.
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
(function () { | |
angular | |
.module('app') | |
.controller('MyController', function ($scope, $state, $log, SomeService) { | |
var vm = this; | |
vm.list = $state.resp; | |
}); | |
})() |
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
I fix it by adding 'clean' task in 'inject' task | |
gulp.task('inject', gulp.series('clean', gulp.parallel('styles', 'scripts'), 'inject')); | |
After any changes in js files .tmp folder is cleaning |
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
{ | |
... | |
"overrides": { | |
"angular": { | |
"dependencies": { | |
"jquery": "~1.8" | |
} | |
} | |
} |
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
// in DOM >> | |
<div class="wantedData" ng-click="vm.getSomeDataValue($event)" data-some="ololo"><> | |
// in controller >> | |
function getSomeDataValue(e) { | |
console.log( angular.element(e.target).data('some') ); | |
} | |
// result | |
"ololo" |
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
// in DOM | |
<div class="test" ng-click="vm.getСoordinates($event)"> | |
... some content ... | |
</div> | |
// in controller | |
function getСoordinates(e) { | |
vm.x = e.clientX; | |
vm.y = e.clientY; | |
console.log(vm.x + ' ' + ' ' + vm.y) |
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
<tr> | |
<td height="10px" style="font-size: 1px;"> </td> | |
</tr> |
- При регистрации юзер вводит некий пароль
- Генерим случайную соль индивилуально для каждого юзера
- Создаем хеш на основе введенного юзером пароля и соли
- Записываем хеш(не пароль) в БД + соль в отдельном филде
- Юзер вводит в поле авторизации некий пароль
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
.not-active-link { | |
pointer-events: none; | |
cursor: none; | |
opacity: 0.5 | |
} |
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
// https://nodejs.org/api/fs.html#fs_fs_mkdir_path_mode_callback | |
// fs.mkdir(path[, mode], callback) callback takes only err arg | |
var fs = require('fs'); | |
fs.mkdir('test_dir', function(err) { | |
if (err) { | |
console.log(err) | |
} else { | |
console.log('looks fine') | |
} | |
}); |