I am looking to create a customizable dialog box in AngularJS where I can pass options such as title and message based on the caller. Essentially, I want to improve upon the standard alert() function.
While the documentation has information on passing parent scope, I am unsure how to pass my own object and retrieve it.
angular.module('myApp').controller('MyController', function($scope) {
ons.ready(function() {
ons.createDialog('dialog.html', {parentScope: $scope}).then(function(dialog) {
$scope.dialog = dialog;
});
});
// This variable will be available in the dialog scope as well.
$scope.myVariable = 'Hello!';
});
My main question is how do I pass an object and access it in the controller of my dialog:
app.controller('generalSucessPopupController', function($scope){
});