What I'm Looking For
I require a sequence of interactive screens that progress to the next screen upon button click. Each previous screen should collapse while loading the new screen using a partial view from the MVC backend.
My Current Setup
Currently, I have an AngularJS controller with the following function:
self.AddChild = function (uri, targetContainerId, collapseTitle, breadCrumbContainerId) {
var target = $("#" + targetContainerId);
if (target != 'undefined' && target != undefined && target.length > 0) {
apiService.Get(uri).then(function (viewData) {
self.CollapsePreviousChild(self.ChildCount);
// Increment child count by 1
self.ChildCount += 1;
// Set HTML data
var html = '<div id="collapsibleScreen-"' + self.ChildCount + ' class="open">' + viewData + '</div>';
target.html(html);
// Update screens collapse status
self.UpdateScreenBreadCrumb(collapseTitle, breadCrumbContainerId);
});
};
}
The UpdateScreenBreadCrumb function is operational and independent.
This function can be called as follows:
self.AddChild("/Partials/View1", "targetContainer", "View", "breadCrumbContainer");
Current Functionality
The View's content, a form, is successfully loaded and the breadcrumb is accurately updated.
Issue To Be Addressed
Within the loaded partial view, there exists a button defined like this:
<button class="btn btn-primary" ng-click="AddPartialView()">Add partial view</button>
Unfortunately, clicking on this button does not trigger any action. Even adding a console.log('Code was here.') within AddPartialView() shows no output. Similarly, setting the ng-click value directly to alert('hello') yields no results either.
No visible errors are present.
Do you have any suggestions for making this button functional?