Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4838

Hide or show controls Panel, using jQuery Ajax GET

$
0
0

@Rafal_P wrote:

Hey guys, I want to create an app that will show controls if user is authorize and hide controls, on the start, and I'm using node.js to answer if the user is authorized or not. That's my code:

// _app/controllers/index.js_
showControls:false,
check: function ()
{
Ember.$.ajax
({
type:"GET",
url:"http://localhost:3000/check/",
dataType: 'text',
success:function(data)
{
if(data==="true")
{
this.toggleProperty('showControls');
}
}
});
}.on('init'),

and that's from Back-End:
router.get('/check', function(req, res)
{
return res.json(true);
});

I think that the toggleProperty inside the Ember.jQuery Ajax GET is not working, what should I do in that case?

Greetings, Rafał

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4838

Trending Articles