Updates notes

This commit is contained in:
Shannon
2020-06-26 11:17:59 +10:00
parent 8ee9ac7e16
commit b8893968e5
2 changed files with 5 additions and 8 deletions

View File

@@ -27,19 +27,18 @@
var model = this;
model.$onInit = function () {
// Ugh, due to the way we work with angularjs and property editors not being components and needing to use ng-include,
// it means we need to expose things directly on the $scope so they can use them.
// It also means we need to watch for changes and upate the $scope values.
// it means we need to expose things directly on the $scope so they can use them.
$scope.block = model.block;
$scope.api = model.api;
$scope.index = model.index;
};
// We need to watch for changes on primitive types and upate the $scope values.
model.$onChanges = function (changes) {
if (changes.index) {
$scope.index = changes.index.currentValue;
}
// TODO: Wouldn't we need to watch for any changes to model.block/api here too?
}
}

View File

@@ -28,8 +28,7 @@
model.$onInit = function () {
// Ugh, due to the way we work with angularjs and property editors not being components and needing to use ng-include,
// it means we need to expose things directly on the $scope so they can use them.
// It also means we need to watch for changes and upate the $scope values.
$scope.block = model.block;
$scope.api = model.api;
$scope.index = model.index;
@@ -44,12 +43,11 @@
$compile(shadowRoot)($scope);
}
// We need to watch for changes on primitive types and upate the $scope values.
model.$onChanges = function (changes) {
if (changes.index) {
$scope.index = changes.index.currentValue;
}
// TODO: Wouldn't we need to watch for any changes to model.block/api here too?
}
}