I am using ionicframework together with TypeScript. When I create a modal object as seen below, the modal object is created successfully but inside the callback where it says this.$scope.modal = modal; this is referencing the browser window and hence the $scope is undefined. How can I get this to point to the class?
export class MyCtrl {
constructor(private $scope: any, private $ionicModal) {
// Load the modal from the given template URL
this.$ionicModal.fromTemplateUrl('MyApp/myModal.html', (modal) => {
this.$scope.modal = modal;
}, {
// Use our scope for the scope of the modal to keep it simple
scope: this.$scope,
// The animation we want to use for the modal entrance
animation: 'slide-in-up'
});