I am starting to use AngularJs on a rails app. And I wanted to know how to manage communication between rails and angularjs. I wanted to generate templates with rails and then angularjs will execute controllers to update view :
.span6.box.applications{ "ng-controller" => "ApplicationListCtrl"}
.padding5.clearfix
.clearfix
%h2.inline.pull-left.no-border= t('home.titles.applications')
.content.top5
- if @applications.count > 0
%table.table.table-striped
%thead
%tr
%th= Application.human_attribute_name(:id)
%th= Application.human_attribute_name(:name)
%th
%tbody
%tr{ "ng-repeat" => "application in applications" }
/ %div{ "ng-include" => "", "src" => "'/applications/new.html'" }
%td {{application.name}}
%td {{application.name}}
%td{ width: "50px"}
.pull-right
- if can? :edit, Application
%span.fui-gear{"data-toggle" => "tooltip", :title => t('form.settings'), "ng-click" => "edit()" }
- if can? :read, Application
%span.fui-search.left10{"data-toggle" => "tooltip", :title => t('form.show'), "ng-click" => "show()"}
The problem is that I have a bad visual effect. It first displays me this :
then it will change it for :
It works but I have the visual effect. How can I manage that. How can I create module reusable with AngularJs ?