Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9153857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:20:28+00:00 2026-06-17T12:20:28+00:00

I want a computed property to observe a non-ember global: a specific key in

  • 0

I want a computed property to observe a non-ember global: a specific key in localStorage. Is this possible? The following does not seem to cut it:

someProperty:function(){
    //some functionality
}.property('localStorage.someKey')

Is it possible to do what I’m trying to do directly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:20:29+00:00Added an answer on June 17, 2026 at 12:20 pm

    In general, you can observe regular JavaScript objects just fine. You just need to use Ember.get and Ember.set to modify them:

    var pojo = {};
    
    var MyObject = Ember.Object.extend({
      bigEyeballs: function() {
        var O_O = this.get('pojo.O_O');
        if (O_O) { return O_O.toUpperCase(); }
      }.property('pojo.O_O')
    });
    
    var obj = MyObject.create({ pojo: pojo });
    console.log(obj.get('bigEyeballs'));
    
    Ember.set(pojo, 'O_O', "wat");
    console.log(obj.get('bigEyeballs'));
    

    You can see this working in this JSBin.

    Local Storage is a bit of a different matter, as it’s not really a normal JavaScript object. You can create a small Ember wrapper around local storage, and use that for observation:

    var LocalStorage = Ember.Object.extend({
      unknownProperty: function(key) {
        return localStorage[key];
      },
    
      setUnknownProperty: function(key, value) {
        localStorage[key] = value;
        this.notifyPropertyChange(key);
        return value;
      }
    });
    
    var storage = new LocalStorage();
    
    var MyObject = Ember.Object.extend({
      bigEyeballs: function() {
        var O_O = this.get('pojo.O_O');
        if (O_O) { return O_O.toUpperCase(); }
      }.property('pojo.O_O')
    });
    
    var obj = MyObject.create({ pojo: storage });
    
    console.log(obj.get('bigEyeballs'));
    
    Ember.set(storage, 'O_O', "wat");
    console.log(obj.get('bigEyeballs'));
    

    You can see this live on JSBin.

    In both cases, the important thing is that you will have to use Ember-aware setting and getting in order to observe these properties.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

May be it sound dumb but if I want some computed value from other
I want to ask how to add a computed column in BIRT that compute
I want to search the computer from this table and when i have stored
I want this function (defn ret-lowest-str-len Computes the lengths of two strings. Returns default
Using ember data, I've run across an issue during serialization where computed properties are
I want to get an entity key knowing entity ID and an ancestor. ID
It is possible in SQL Server 2005 to create a computed column that is
I want to bypass CSS transition and change a property instantly. I tried to
Can I define a WiX property that will have a value computed from other
It seems that if the property 'owner' of a computed field is set to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.