Skip to content

[0.8.0-rc.5] observers as an array #1527

Closed
@jasonpecor

Description

Property observers work when custom element is instantiated, but never after that. No errors in console. Here is the javascript from the custom element definition used in my test:

var ChatUser = Polymer({
    is: "chat-user",
    properties: {
        user: Object
    },
    constructor: function (user) {
        this.user = user;
    },  
    observers: [
        "userStatusChanged(user.status)"
    ],  
    userStatusChanged: function (status) {
        console.log("updating status", status);
        this.notifyPath("user.status", status);
    }
});

Testing the custom element's observer:

var userData = {username: "Bob", status: "Offline"};
var user = new ChatUser(userData); // console logs "updating status Offline"
// change status
userData.status = "Online"; // observer ignores this

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions