You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using $scope.$broadcast('schemaFormRedraw'); after dynamically adding elements to my angular-schema-form, however, when I do this, it refreshes the form and reverts back to the first tab every time.
I've had a look at the render() and internalRender() functions inside the schema-form.js and have a feeling it's something in those two functions.
Here is how I am adding the elements:
//declaring the form and schema on enter
$scope.$on("$ionicView.enter", function(event, data) {
$scope.schema = {
type: "object",
properties: {
}
};
$scope.form = [
"name",
{
type: "tabs",
tabs: [
]
}
];
});
//adding tabs
$scope.tabAdd = function(tabName){
console.log($scope.form[1].tabs.length);
if($scope.form[1].tabs.length == 0){
$scope.state = 0;
}
else{
$scope.state = $scope.state +1;
}
console.log($scope.state);
var tab = {
title: tabName,
tabType: "top",
items: []
}
$scope.form[1].tabs.push(tab)
//this prevents the updateOn error that I get without it
$scope.$broadcast('schemaFormRedraw');
};
@json-schema-form/angular-schema-form-lead
The text was updated successfully, but these errors were encountered:
@GenyaB the schema and form are compiled into an Intermediate Representation which is then used for the display, updating the schema or form then regenerates the IR which causes the form to regenerate display. I have been wanting to find time to create a tab add-on that allows defining a schema/form to dsiplay as the content of the tab, but keep running out of time.
I am using $scope.$broadcast('schemaFormRedraw'); after dynamically adding elements to my angular-schema-form, however, when I do this, it refreshes the form and reverts back to the first tab every time.
I've had a look at the render() and internalRender() functions inside the schema-form.js and have a feeling it's something in those two functions.
Here is how I am adding the elements:
//declaring the form and schema on enter
@json-schema-form/angular-schema-form-lead
The text was updated successfully, but these errors were encountered: