-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(dialog): support using AngularJS 1.5+ components directly #8409
Comments
Everything works for me perfectly. Please modify the codepen to represent your issue. I guess, your dialog is not opening, because you set |
Hi @devversion , From your demo code i understand that i want to pass the
|
@pavankumarkatakam That's true. It seems like our compiler does not support this concept. I can see the relevance and think it would be a good enhancement for the $$interimElement factory. |
A related point, it would be nicer if there was a property where you could set the name of the component, rather than writing out the whole template in the template property. You can do this in ui-router 1.0.0-alpha.4. It would come in handy when you want to programmatically set the component, otherwise you will need to fiddle with strings etc. $mdDialog.show({
component: 'taskShow',
parent: $rootElement,
scope: $scope,
preserveScope: true,
clickOutsideToClose: true
}); |
I think this demo is broken. I am running to this issue today. |
@Shaunwei the demo just worked for me. I'd also add a note, that, if you don't want to pollute the current scope you can create an isolate scope instead: ctrl.openItem = function(item, $event){
// not polluting current $scope...
var scope = angular.extend($scope.$new(true), {
item: item
});
$mdDialog.show({
template: '<test item="item"></test>',
scope: scope
});
}; |
@joaovieira From your example I wasn't able to bind the data to the component. However I was able to access the data in the dialog controller by using |
If the component uses Maybe a race condition between the animation and the loading of the template. Edit: http://plnkr.co/edit/GceMCA99eY9ZaTKSEKl6?p=preview |
I may take a stab at this sometime in the near future |
@codymikol that would be great. Please let me know how I can help 😄 |
Is there any movement to directly support "component" as a property of the show() like they have had in bootstrap angularjs since 1.5? |
@ewahner nothing more than you can see here in this issue. A PR for this would be welcomed and I can provide some support to the author. |
As mentioned in #10508 (comment), any implementation of this will need to ensure that |
Actual behavior:
$mdDialog
service is not working with angular 1.5 components.May the problem with template, it is not accepting the task as input. which is binding for
taskShow
componentIt should open an dialog with given component template
CodePen or Steps to reproduce the issue: *
Angular Versions: *
Additional Information:
The text was updated successfully, but these errors were encountered: