1

once a certain process is done I need to set a boolean to true in order to update the template.

I can easily get the object, but setting a property seems to be more difficult. What I use to get the object is

var found = self.get('content').findProperty('id', self.datasetid);

If I do that in the chrome console I can clearly see that I get an ember object back:

Object {id: 1, active: true}
__ember1364221685101_meta: Meta
active: true
get data_set: function () {
id: 1
set data_set: function (value) {
__proto__: Object

When I do:

found.set('data_set.fully_geocoded', true);

I do get the error mentioned in title. I've tried as many different flavours as I could think of, but all with the same result.

Could somebody shine a light on this?


Login to craigslist to retrieve account page using Delphi and Indy and SSL

I am trying to log into craigslist using Delphi, and retrieve my account page (in order to gather a listing of all my posts)

However, I can't seem to get the login to work, what Am I doing wrong?

function TfrmMain.Login: string;
var
  IdHTTP: TIdHTTP;
  Request: TStringList;
  Response: TMemoryStream;
begin
  Result := '';
  try
    Response := TMemoryStream.Create;
    try
      Request := TStringList.Create;
      try
        Request.Add('op=login');
        Request.Add('redirect=http://newyork.craigslist.org/');
        Request.Add('login=' + myEmail);
        Request.Add('password=' + myPassword);
        IdHTTP := TIdHTTP.Create;
        try
          IdHTTP.AllowCookies := True;
          IdHTTP.HandleRedirects := True;
          IdHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
          IdHTTP.Post('https://accounts.craigslist.org/login', Request, Response);
          Result := IdHTTP.Get('https://accounts.craigslist.org/');
        finally
          IdHTTP.Free;
        end;
      finally
        Request.Free;
      end;
    finally
      Response.Free;
    end;
  except
    on E: Exception do
      ShowMessage(E.Message);
  end;
end;

I get a exception class EIdIOHandlerPropInvalid with message 'IOHandler value is not valid' on the line:

IdHTTP.Post('https://accounts.craigslist.org/login', Request, Response);

thanks

4

1 回答 1

2

AnObject不是 Ember.Object 的实例,而是基 Javascript 类Object,因此它不会有getandset方法。

您可以通过使用Ember.getandEmber.set直接传入对象来获得许多相同的功能,如下所示:

Ember.set(found, 'data_set.fully_geocoded', true)
Ember.get(found, 'data_set.fully_geocoded')

计算属性和观察者也可以基于使用Ember.set这种方式触发。

于 2013-03-25T16:19:28.477 回答