Accessing angular elements in onSubmit catalog clients scripts in order guides.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2019 02:02 PM
In an on-submit catalog client script you can access angular scope data with the following: this.angular.element("#sc_cat_item").scope().data.whatever.
This does not work with order guides. I can't find any kind of handle in the SC Order Guide widget. Has anyone else had luck with that?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2019 02:57 PM
have you tried this.angular.element("#sc_cat_item_guide").scope().data.whatever.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2019 06:44 AM
Tanks for the time Mike!
These all log that there is an object returned, even the bogus one, ok fine.
console.log("1:" + this.angular.element("#sc_cat_item"));
console.log("2:" + this.angular.element("#sc_cat_item_guide"));
console.log("3:" + this.angular.element("#ThisDoesNotExist"));
The weird part is ,it ends up logging undefined if you add the .scope() to those during "onSubmit" catalog client scripts. (Obviously the "thisDoesNotExist" one should be undefined). I also tried "#orderGuideModal" with the same results. I can't help but think I've still got the wrong selector. I've cloned the widget for something unrelated, what ends up driving the element name?
When you control+right click and log scope and scope.data to console that DOES log the scope. I'm worried it is something specific to onSubmit catalog client scripts but I really think I've just got the wrong selector.