У меня есть директива, и в этой директиве у меня есть значение, полученное от моего контроллера, вот моя директива:
angular
.module('thermofluor')
.directive('tablePlate', tablePlate)
tablePlate.$inject = ['$timeout', '$q'];
function tablePlate($timeout, $q) {
var directive = {
link: link,
restrict: 'E',
templateUrl: '/crims/thermofluor/experiments/table_plate.html',
scope: {
plate: '='
}
};
return directive;
function link(scope, element) {
console.log("test");
var plate = scope.plate;
console.log(plate);
scope.letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];
scope.numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
experiments = [];
experiments[scope.plate.experiment.well] = [scope.plate.experiment];
return;
}
}
Проблема в том, что когда я console.log
прицел вижу свой пластинчатый объект со всем необходимым внутри, но когда я пытаюсь console.log
scope.plate
объект, объект меняется, и он возвращает мне $$state
и я не знаю, как использовать это $$state
У кого-нибудь есть идея?