mddialog

angular material load angularjs 1.5 component into $mdDialog

让人想犯罪 __ 提交于 2021-02-04 15:38:28
问题 The goal: to use components and not use $scope to set data. There isn't an error to share, the issue is that the data element isn't set when the dialog loads the component. The screen shot shows the current state of the dialog, there should be an object bound in tab #2 (Info). I can verify the the object (document) is available after the dialog loads using the onComplete event. I've tried to bind the data available to the dialog call to the component in the following ways below: 1 using

Angular Material and Jasmine : “ No provider for InjectionToken MdDialogData! ”

痞子三分冷 提交于 2020-01-11 21:10:00
问题 I have a component which is meant to be used in an Angular Material MdDialog : @Component({ ... }) export class MyComponent { constructor(@Inject(MD_DIALOG_DATA) public data: any, public dialogRef: MdDialogRef<MyComponent>) { ... } } I am trying to Unit Test it with Jasmine : describe('MyComponent', () => { let component: MyComponent; let fixture: ComponentFixture<MyComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ SharedTestingModule, ], declarations: [

Angular Material and Jasmine : “ No provider for InjectionToken MdDialogData! ”

我怕爱的太早我们不能终老 提交于 2020-01-11 21:09:39
问题 I have a component which is meant to be used in an Angular Material MdDialog : @Component({ ... }) export class MyComponent { constructor(@Inject(MD_DIALOG_DATA) public data: any, public dialogRef: MdDialogRef<MyComponent>) { ... } } I am trying to Unit Test it with Jasmine : describe('MyComponent', () => { let component: MyComponent; let fixture: ComponentFixture<MyComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ SharedTestingModule, ], declarations: [

Angular material md-select not closing when in mdDialog

风格不统一 提交于 2019-12-24 06:57:26
问题 I am using angular material version 1.1.4, angular version 1.5.9 and I have the following issue with an md-select directive. I open a dialog using $mdDialog service on a click of a button. The dialog is fullscreen. Inside I have multiple inputs, along with an md-select input. On md-select you can choose multiple items, so it doesn't automatically close after choosing an item from the list. After opening it and selecting the items you desire, you click outside of it to close it and get to the

mdDialog: catch the onClose event

泄露秘密 提交于 2019-12-23 07:49:43
问题 I'm creating a mailbox in angular. And I would need to save the draft message when the popup to send a message closes. I know there are some alternatives: scope.$on("$destroy", function () { saveMessage() }); and: $mdDialog.show(...).finaly(function(){ saveMessage() }); But both are insufficient: The first is called when the Dialog is already closed. This is due to the requirements unacceptable (there is an iFrame that needs to be open) The second is outside the scope of the controller of the

Testing component that opens md-dialog

懵懂的女人 提交于 2019-12-10 23:43:02
问题 I am trying to write a unit test for an Angular component that opens a dialog, but am unable to do so because I cannot trigger the closing of the dialog. How can I cause the md dialog to resolve from the test case? I have created a repository with a basic example where the problem can be reproduced, and copied the central bits below. There is an index.html to manually verify that the code is working, a test case that displays the problem and an example of how the tests are written in the md

Angular-Material : md-select in md-dialog not closing

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 20:39:43
问题 I've created a simple directive that consists in a form with few md-input and one md-select . I've used my directives in a few pages now and everything works fine, but now i would like to use it inside an md-dialog and it's not working as expected, i can't close the md-select-menu if i click outside of it, even if i focus an md-input. So the only two ways for the user to close the menu is to either select an option or dismiss the dialog. It's not that bad but i found this rather annoying.

Angular MaterialJS Dialog form with different save options

人盡茶涼 提交于 2019-12-06 15:13:32
问题 I'm trying to save form data in mdDialog but with options of (save and close) the dialog and (save) which will save the form data then open another dialog empty dialog without having to close and open the mdDialog again, the problem is how to call same SaveData function in same form for both save operations? $scope.saveData = function (isValid) { if (isValid) { updateservice.postdata($scope.myformdata) .then(function (data) { $mdDialog.hide(); }); // error handling } }; and in the template:

Angular MaterialJS Dialog form with different save options

对着背影说爱祢 提交于 2019-12-04 21:10:35
I'm trying to save form data in mdDialog but with options of (save and close) the dialog and (save) which will save the form data then open another dialog empty dialog without having to close and open the mdDialog again, the problem is how to call same SaveData function in same form for both save operations? $scope.saveData = function (isValid) { if (isValid) { updateservice.postdata($scope.myformdata) .then(function (data) { $mdDialog.hide(); }); // error handling } }; and in the template: <md-dialog> <form name="form" ng-submit="saveData(form.$validform)" novalidate> <md-dialog-content> <div

Using MdDialogConfig data on Angular 2

霸气de小男生 提交于 2019-12-01 05:49:19
I'm trying to use a dialog component in Angular 2 using @angular/material2.0.0-beta.1 . What I'm trying to accomplish is to send data (which are values that a person chooses from the interface, the dialog is used to make the person confirm the values they chose) to the dialog and display it. So for example the dialog should say something like this: You chose: option 1: value option 2: value option 3: value Cancel | Confirm How can I pass these values to the dialog I create so that I can just access them like so {{value}} in the view template? I think its using the data config, but I can't seem