<li *ngFor="let u of users">{{u?.name}}</li>
myApp.directive('superPuper', function() {
return {
restrict: 'E',
replace: true,
link: function($scope, element, attrs) {
var val = $scope.x;
if(val !== 3) {
//Ничего не выводим!!!
var li = angular.element('<li>');
li[0].textContent = val;
element.append(li);
}
}
}
})
{ path: 'table/:page', component: myTable },
return $http.get('getData.php')
.then(function(response) {
return response.data;
},
function(error) {
console.log(error);
});
var status = serviceDataByCommands.add(vm);
status.then(function(response){
if (response=== 'success'){
vm.notify('Данные успешно добавленны!');
vm.lists.push({
id: response.data.id,
command: response.data.command,
description: response.data.description,
completed: response.data.completed
});
}
})
app.use('/*', express.static(__dirname+ '/'));
this.myForm= this.fb.group({
'checboxGroup': this.fb.group({
'first': [false],
'second': [false]
})
});
<my-title-component [checboxGroup]="myForm.controls['checboxGroup']"></ my-title-component>
@Input() checboxGroup: FormGroup
.factory('faqSocket', function($websocket,$rootScope) {
var factory = {}
var dataStream = $websocket('wss://api.myserver.com/faq/');
dataStream.onMessage(function(message) {
$rootScope.$apply(function () {
factory.answer = message['data'];
});
factory.dataStream = dataStream ;
return factory;
})
const fs = require('fs');
const StringDecoder = require('string_decoder').StringDecoder;
const decoder = new StringDecoder('utf8');
// читаем файл
fs.readFile(path, (e, file) => {
if (e) throw new Error(e);
file = decoder.write(file); // конвектируем в строку
file = file.replace('строка которую меняем', 'строка на которую меняе');
fs.writeFile(patch, file, callback); // записываем обратно
})