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
});
}
})
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;
})
{ path: '',
loadChildren: './view/view.module#ViewModule'
//component: ViewComponent
}