Guss Guss - 6 months ago 16x
Javascript Question

I keep getting "observer method not found" error on my Polymer element

I've created a simple polymer element to display shopping cart item in reverse order from the order they were ordered (so newest items appear on top) to be displayed on the side bar of my store.

To implement this, I've added an observer on the

property that updates a
property by sorting the data in reverse. All very simple:

<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/paper-styles/typography.html">

<dom-module id="controll-cart-summary">
<style is="custom-style" include="shared-styles"></style>

<paper-material elevation="3" lang="he">
<h3>עגלת קניות</h3>

<paper-menu class="shopping-cart">
<template is="dom-repeat" items="{{cartDisplay}}" as="timeslot">


is : 'controll-cart-summary',
properties : {
cart : {
type: Array,
observer: 'updateCart'
cartDisplay : Array,

ready : function() {

attached : function() {

updatecart : function() {
this.cartDisplay = this.cart.reverse();

But every time the element loads I get this error in the console:

[controll-cart-summary::_observerEffect]: observer method `updateCart` not defined

I've created elements before, with observers, and when I get this error it is usually some simple typo - but I can't locate any such simple error here. What am I missing?


I guess case differences matter in fuction names (not sure, I'm not a JS dev)

observer: 'updateCart'

updatecart : function() {