Comments on: Pass Data to a UI-Bootstrap Modal Without $scope https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/ Wed, 29 Apr 2020 09:02:00 +0000 hourly 1 By: Ежевичное Варенье https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-374 Wed, 29 Apr 2020 09:02:00 +0000 https://brianhann.com/?p=323#comment-374 we have completely another syntax in this plugin

]]>
By: Rama Prasad https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-358 Wed, 16 May 2018 07:35:00 +0000 https://brianhann.com/?p=323#comment-358 Thanks Brian,
Looks like plunker is broken now. it would be great to see the code.

]]>
By: Sergio Bertomeu Rodríguez https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-303 Wed, 08 Feb 2017 23:56:00 +0000 https://brianhann.com/?p=323#comment-303 Thank you for this solution. It helped me a lot.

]]>
By: Karanja Denis https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-269 Wed, 21 Sep 2016 06:31:00 +0000 https://brianhann.com/?p=323#comment-269 Nice post. Thanks

]]>
By: Gary Blake ヅ https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-226 Thu, 24 Mar 2016 14:19:00 +0000 https://brianhann.com/?p=323#comment-226 Spot on. Can i have your children? I don’t actually want your children just so you don’t call the police.

]]>
By: Emlyn Maduray https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-218 Thu, 25 Feb 2016 14:43:00 +0000 https://brianhann.com/?p=323#comment-218 Hi there

I’m new to Angular. I am trying to do something similar. However the controller for my template is in it’s own file. When I move the controller function into the parent function definition it works as described in the post. But, if it’s in a separate file, then it throws a ReferenceError – ie. function not defined… How do I make the current controller (parent) aware of the modal’s template’s controller. I have checked to make sure that the files are loaded…
I feel like I’m missing something simple – all my other controllers are bound to templates via the $stateProvider routing function… Not sure how to tell one controller about the existence of another.
Any feedback will be appreciated.

Thanks
E

]]>
By: Thomas N. Eaves https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-210 Fri, 12 Feb 2016 12:49:00 +0000 https://brianhann.com/?p=323#comment-210 Dear god, Brian, thank you for this article. It has taken me f***ing forever to find someone who actually is attempting to do the same thing I am. Superbly written. Bless you and your future generations to come.

]]>
By: Brian Hann https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-196 Thu, 14 Jan 2016 16:20:00 +0000 https://brianhann.com/?p=323#comment-196 I don’t think you should take my example as an architectural imperative 🙂 Doing the processing in a promise handler in the main controller makes a lot of sense to me. If that seems cleaner to you I say go for it.

]]>
By: Travis Miller https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-195 Wed, 13 Jan 2016 21:45:00 +0000 https://brianhann.com/?p=323#comment-195 I see that you do the actual processing—in this case, deleting person from the people array—within the modal controller, rather than in the main controller via $uibModal.open().result.then(). Is this the recommended approach, architecturally speaking?

I’m just exploring the pros and cons of different approaches here, and wondering whether “do the processing in the modal controller, not the main controller” is the preferred pattern for UI Bootstrap modals.

]]>
By: Brian Hann https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-183 Wed, 16 Dec 2015 15:21:00 +0000 https://brianhann.com/?p=323#comment-183 Looks like you got an answer on your SO question. Hope that worked for you!

]]>
By: jimmyklife https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-182 Tue, 15 Dec 2015 23:17:00 +0000 https://brianhann.com/?p=323#comment-182 id like to pass data from 1 view to other using the modalinstance but am unable to , kindly help out , link to question http://stackoverflow.com/q/34301233/1226748

]]>
By: Brian Hann https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-179 Mon, 07 Dec 2015 18:17:00 +0000 https://brianhann.com/?p=323#comment-179 Great! Glad you found it helpful.

]]>
By: Aaron Drake https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-178 Mon, 07 Dec 2015 18:00:00 +0000 https://brianhann.com/?p=323#comment-178 Thanks for this! Helped me out tremendously!

]]>
By: Brian Hann https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-81 Tue, 30 Jun 2015 15:26:00 +0000 https://brianhann.com/?p=323#comment-81 Yea my guess is the modal controller doesn’t inherit from whatever controller you’re calling it from. It might be easier to think of it as a service that performs DOM operations. If you want to share data with a service you have to pass it in manually.

Instead of passing the whole controller through resolve can you just pass properties like I’ve done above?

]]>
By: lye https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-79 Mon, 29 Jun 2015 02:06:00 +0000 https://brianhann.com/?p=323#comment-79 I’m having a problem where in all of my views I’m able to access variables from the parent controller (using controller as syntax) by doing appCtrl.users (all the users) but in the modal this does not work because the modal somehow isn’t contained within the application controller and I can’t pass a parent controller in resolve. Any ideas?

]]>
By: Delip Rao https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-18 Tue, 28 Apr 2015 20:39:00 +0000 https://brianhann.com/?p=323#comment-18 Thanks! This looks real cool.

]]>
By: Brian Hann https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-17 Tue, 28 Apr 2015 20:33:00 +0000 https://brianhann.com/?p=323#comment-17 Thanks! It’s Crayon Syntax Highlighter: https://wordpress.org/plugins/crayon-syntax-highlighter/

]]>
By: Delip Rao https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-16 Tue, 28 Apr 2015 19:36:00 +0000 https://brianhann.com/?p=323#comment-16 Love this. What WP plugin you use for syntax highlighting the code?

]]>
By: Brian Hann https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-12 Sun, 26 Apr 2015 13:26:00 +0000 https://brianhann.com/?p=323#comment-12 Unfortunately because the locals are defined in the parent controller, you can’t use $inject. There’s no way for the injector to know what the locals are when the app bootstraps. You could use an intermediary service and pass “people” and “person” through that though.

I may be wrong about this but I couldn’t get $inject working with resolve after trying a bunch of different methods.

]]>
By: gdi2290 https://brianhann.com/pass-data-to-a-ui-bootstrap-modal-without-scope/#comment-11 Sun, 26 Apr 2015 12:37:00 +0000 https://brianhann.com/?p=323#comment-11 I would add $inject to DeleteModalCtrl or use ng-annotate rather than having the annotations defined in a different file

]]>