Polymer 1.0 access parent e.model in nested repeats

<template is="dom-repeat" items="{{items}}" as="first"> <template is="dom-repeat" items="{{first}}" as="second"> <span on-tap="test">{{second}}</span> </template> </template> items: [["1","2"],["3","4"]], test: function (e) { // access e.model of first }

Is it possible to access the e.model of the outer repeat loop? Just getting the object is not enough (altough this would be a start). I need the model variable to use push/pop on it. To my surprise e.model.first does not exist.

--------------Solutions-------------

<template is="dom-repeat" id="firstRepeat" items="{{items}}" as="first">
<template is="dom-repeat" id="secondRepeat" items="{{first}}" as="second">
<span on-tap="test">{{second}}</span>
</template>
</template>

<script>
items: [["1","2"],["3","4"]],
test: function (e) {
// First model
this.$.firstRepeat.modelForElement(e.target);

// Second model
this.$.secondRepeat.modelForElement(e.target);
}
</script>

Category:polymer Time:2018-12-05 Views:0

Related post

  • Rails 3.1 - Accessing Parent Application Models from Mountable Engine 2012-04-03

    I want to create a parent application that deals with the User Authentication. I then want to create various Mountable Engines (like a blog, contact directory, etc.) that can be added as needed. This means that I will need to access the User Authenti

  • Javascript: Accessing parent properties from inside nested function 2012-01-01

    How to access somevar:'this is Foo' from inside bar.foo() ? function Foo(){ this.somevar='this is Foo'; } Foo.prototype={ bar:{ somevar:'this is bar' ,foo:function(){ console.log(this); } } } var instance = new Foo(); instance.bar.foo(); Here is link

  • ASP.NET MVC2 - is it possible to access parent view's model data from partial view? 2010-09-24

    In handling a 1--->0...1 relationship, I'm trying to use a separate partial view for the 0...1 end. I'd like to use RenderPartial() rather than RenderAction(), for the sake of efficiency. Is it possible to gain access to the containing view's mode

  • Do rails rake tasks provide access to ActiveRecord models? 2009-05-18

    I am trying to create a custom rake task, but it seems I dont have access to my models. I thought this was something implicitly included with rails task. I have the following code in lib/tasks/test.rake: namespace :test do task :new_task do puts Pare

  • Better way of child object accessing parent object? 2011-06-08

    I have some JS you'll see below. I want the inner class object to be able to access it's parent. It needs to access parent methods and properties. The way I've done it is working, but I'd like to know if there's something I can do in the inner class

  • knockout: accessing the View Model through an iframe? 2011-08-30

    The app I'm building requires the use of iframes for wysiwyg text editing, and these iframes need to be wired up to the viewModel, but I'm finding that this clashes with knockout... or at least knockout seems not to apply bindings when I try to acces

  • Access parents variables in Python 2011-10-15

    I have something like this: class SomeObject: #code to access parents MyVar class MyClass: MyVar = 3 MyObject = SomeObject() I need to access MyVar from inside MyObject. Is there any way I can do that? Thank you! --------------Solutions-------------

  • How to access the original model inside of an ActiveRecord association method 2011-11-04

    I've been using ActiveRecord association methods (such as in this post Ryan's Scraps) to perform some of my more complex 2nd level associations, while minimizing query counts. For example, I use the following association to pull all activity from eve

  • handlebars - is it possible to access parent context in a partial? 2012-02-23

    I've got a handlebar template that loads a partial for a sub-element. I would need to access a variable from the parent context in the calling template, from within the partial. .. doesn't seem to resolve to anything inside the partial. Simplified co

  • What is the difference between these two methods of accessing the SharePoint model? 2008-11-20

    Out of the several ways of accessing the SharePoint model of a SharePoint Services 3.0 site from an ASP.NET application, two seem to be very similar: SPWeb site = SPControl.GetContextWeb(Context); SPWeb site = SPContext.Current.Web; It is my understa

  • Access parent datacontext in listbox in Silverlight 2008-12-22

    In Silverlight 2 I'm using a usercontrol which inherits the datacontext of the page that it's embedded on. This datacontext contains question text, a question type and a collection of answers. In the user control is a listbox which is bound to the co

  • Accessing parent control from child control - ASP.NET C# 2009-03-30

    I have a parent user control with a label. On the parent's OnInit, I dynamically load the child control. From the child control, I will need to set the parent's label to something. Using the Parent property returns the immediate parent which is actua

  • PHP Child class accessing Parent variable problem 2009-05-06

    I got this class: Class Username { protected $id; protected $username; protected $contact_information; private __construct($id) { $this->id = (int) $id; // Forces it to be a string $contact_information = new ContactInformation($this->id); } } C

  • How to access parent Iframe from javascript 2009-06-01

    Well, I have an IFrame, which calls a same domain page. My problem is that I want to access some information from this parent Iframe from this called page (from javascript). How can I access this Iframe? Details: There are severals Iframes just like

  • Calculate depth in a parent-child model in MySQL 2009-07-28

    How do I calculate a node's depth in a parent-child model under MySQL? I'll need the depth to, among other things, create the indent in my list (coded with PHP). --------------Solutions------------- That depends on the actual implementation of your h

  • Accessing parent data in nested repeater, in the HeaderTemplate 2009-09-11

    Simple question, not sure there's a simple answer! So here's the code: (I've simplified it a lot to make it easier to read) <asp:Repeater runat="server> <ItemTemplate> <asp:Repeater runat="server"> <HeaderTemplate> <h1>M

  • WPF Close UserControl in Frame and access Parent Controls 2010-01-07

    I have a WPF app with a Window (RootWindow) with a Toolbar and a Frame (ContentFrame). Initially the Toolbar is hidden. I load a Login UserControl into the Frame and when the user correctly logs in I'd like to close the UserControl and then make the

  • How to access the joining model on a has_many :through relationship 2010-02-17

    I have a typical many-to-many relationship using has_many => :through, as detailed below. class member has_many member_roles has_many roles, :through => :member_roles end class role has_many member_roles has_man members, :through => :member_

  • Help with generating a report from data in a parent-children model 2010-03-01

    I need help with a problem regarding data saved in a parent-children model table and a report I need to build upon it. I've already tried searching for topics about parent-children issues, but I couldn't find anything useful in my scenario. What I ha

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 1.300 (s). 14 q(s)