Call controller without action


#1

i have code:

{{#each App.tweetsController}}
					        <div class="social-feed-element">
							    <a class="pull-left" href="{{author_link}}" target="_blank">
							        <img {{bindAttr src="author_picture"}} />
							    </a>
							    <div class="media-body">
							        <p><img class="social-network-icon" title="posted by {{social_network}}" src="{{social_icon}}" /><span class="author-title">{{author_name}}</span>
							            
							            <a href="{{link_post}}" target="_blank" class="read-button">
							                <span class="label label-info">open </span>
							            </a>
							        </p>
							        <div>
							            <p class="social-feed-text">{{{message_post}}}</p>
							            <a {{ bindAttr href="link_post" }} target="_blank"><img {{ bindAttr src="attachment_post" }}/></a>
							        </div>
							    </div>
							</div>
					    {{/each}}

and ember.js code http://pastebin.com/3wjk2MnX

but how call controller without action, that is, when the page loads?


#2

Your App object has a ready property that you can call to execute code when the page loads ( but really when the App is ready ). Give that a try.

App = Em.Application.create({
    ready: function() {
         // on ready code goes here
    }
});

#3

but how i call my application? i have model, views and controller


#4

sorry, i stupid :slight_smile: i write:

    App = Em.Application.create({
    ready: function(){
        App.tweetsController.loadTweets();
    }
});

and all work )