Angular JS & SObject Remote : Part 1 Bringing Data to Page #NoControllers

Friday, April 3, 2015


Finally back after long long time!

I have been working with AngularJs for a while now and I find Angular to be really helpful to create stateless interactive pages and best part is you hardly need any Apex Controller for the same. Pages are fast, fluid and Mobile friendly (Salesforce 1).

With time I have found the best ingredient to prepare your AngularJS page are

  • AngularJS ( of course )
  • SObject-Remote (thanks to Jason Venable)
  • Bootstrap (not required)

Lets start with a simple example.

Bringing data to the page


This would be a pretty easy example where we will be using SObject-Remote to bring query data from Salesforce Accounts



The Catch

  • The area ng-controller marks the area which can access the $scope variable of that particular controller.
  • You can access variable inside $scope by using {{}}. If you have a variable $scope.accounts you can directly access that in page by doing {{accounts}}, just like regular merge field but a bit different syntax.
  • We have used $scope.$apply() , which generally tells angular to redraw the UI  / View. Since remoting works async we need to notify the angular to redraw once we have the data by calling this method.

End Result

Finally a stateless fluid page without any controllers.


41 comments:

  1. Welcome back! This is a great example of getting started with Angular and Visualforce. Thanks for all your great posts!

    ReplyDelete
  2. Gr8 work Avi...People with Development/technical background will understand ur efforts..Keep it up and would like to see more articles from you..

    ReplyDelete
  3. Gr8 work Avi...People with Development/technical background will understand ur efforts..Keep it up and would like to see more articles from you..

    ReplyDelete
  4. Thank You for sharing your article. I like it. We provide TIBCO Online Training in Hyderabad.

    ReplyDelete
  5. Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this. best sap simple finance online training institute in hyderabad

    ReplyDelete
  6. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…!!..
    AngularJS4 Online Training

    ReplyDelete
  7. Hiiii....Great Post....It's very informative.....Thank you so much for sharing...
    Angular JS Training in Hyderabad

    ReplyDelete
  8. A befuddling web diary I visit this blog, it's incredibly grand. Strangely, in this present blog's substance made motivation behind fact and sensible. The substance of information is instructive
    Oracle Fusion Financials Online Training
    Oracle Fusion HCM Online Training
    Oracle Fusion SCM Online Training

    ReplyDelete
  9. An overwhelming web journal I visit this blog, it's unfathomably amazing. Unusually, in this present blog's substance made inspiration driving truth and reasonable. The substance of data is enlightening
    Oracle Fusion Financials Online Training
    Oracle Fusion HCM Online Training
    Oracle Fusion SCM Online Training

    ReplyDelete
  10. Nice Blog
    Yaaron Studios is one of the rapidly growing editing studios in Hyderabad. We are the best Video Editing services in Hyderabad. We provides best graphic works like logo reveals, corporate presentation Etc. And also we gives the best Outdoor/Indoor shoots and Ad Making services.
    Best video editing services in Hyderabad,ameerpet
    Best Graphic Designing services in Hyderabad,ameerpet­
    Best Ad Making services in Hyderabad,ameerpet­

    ReplyDelete
  11. I am a regular reader of your blog and I find it really informative. Hope more Articles From You.Best
    Tableau tutorial videos available Here. hope more articles from you.

    ReplyDelete
  12. Thank you for excellent article.Great information for new guy like antimalware service executable

    ReplyDelete
  13. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    best angularjs online training
    top angularjs online training
    angularjs online training

    ReplyDelete
  14. Thanks for sharing an informative blog keep rocking bring more details. oracle training in chennai

    ReplyDelete
  15. wonderful article contains lot of valuable information. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
    This article resolved my all queries.good luck an best wishes to the team members.learn digital marketing use these following link
    Digital Marketing Course in Chennai

    ReplyDelete
  16. Did you want to set your career towards Oracle? Then Infycle is with you to make this into reality. Infycle Technologies gives the combined and best Oracle course in Chennai, which offers various stages of Oracle such as Oracle PL/SQL, Oracle DBA, etc., along with 100% hands-on training guided by professional tutors in the field. Along with that, the mock interviews will be given to the candidates to face the interviews with complete confidence. Apart from all, the candidates will be placed in the top MNC's with an excellent salary package. To get it all, call 7502633633 and make this happen for your happy life.Best Oracle Training Institute in Chennai

    ReplyDelete
  17. Reach to the best
    Python Training institute in Chennai
    for skyrocketing your career, Infycle Technologies. It is the best Software Training & Placement institute in and around Chennai, that also gives the best placement training for personality tests, interview preparation, and mock interviews for leveling up the candidate's grades to a professional level.

    ReplyDelete
  18. Chennai's best software training institute, Infycle Technologies, offers the best Hadoop training in Chennai for students and tech professionals along with other courses such as Python, Oracle, Selenium, Java, Hadoop, iOS, and Android development with 100% hands-on training. Once the completion of training, the students will be sent for placement interviews in the core MNC's. Call 7504633633 to get more info and a free demo.Top Hadoop Training in Chennai | Infycle Technologies

    ReplyDelete
  19. Infycle Technologies, the best software training institute and placement center in Chennai offers the No.1 Digital Marketing course in Chennai for freshers, students, and tech professionals at the best offers. In addition to the Oracle training, other in-demand courses such as DevOps, Data Science, Python, Selenium, Big Data, Java, Power BI, Oracle, Cyber Security will also be trained with 100% practical classes. After the completion of training, the trainees will be sent for placement interviews in the top MNC's. Call 7504633633 to get more info and a free demo.Grab Digital Marketing Course in Chennai | Infycle Technologies

    ReplyDelete


  20. Nice to see this BLOG..keep updating More infromation Digital Lync offers one of the best Full Stack training in Hyderabad with a comprehensive course curriculum with Continuous Integration, Delivery, and Testing. Elevate your practical knowledge with quizzes, assignments, Competitions, and Hackathons to give a boost to your confidence with our hands-on Full Stack Training.
    DevOps Training Institute
    Python Training Institute
    AWS Training Institute
    Online Full Stack Developer Course Hyderabad
    Python Course Hyderabad
    Online AWS Training Course Hyderabad
    devops training in hyderabad
    angular training in hyderabad

    ReplyDelete
  21. Good day. I was impressed with your article. Keep it up . You can also visit my site if you have time. Thank you and Bless you always.
    Outsource Angularjs Development in India

    ReplyDelete
  22. I really liked your blog article.Really thank you! Really Cool.
    java course
    learn java online

    ReplyDelete
  23. Infycle Technology, No.1 Software Training Institute in Chennai, afford best Data Science training in Chennaiand also provide technical courses like Oracle, Java, Big data, AWS, Python, DevOps, Digital Marketing, Selenium Testing, etc., and we also provide the best training from the best technical trainers and after completion of training students will be able to crack the jobs on top MNC’s. for more information call 7504633633.

    ReplyDelete
  24. Get the best Best Oracle training in chennai from Infycle Technologies, one of the excellent Software Training Institute in Chennai. Great place to study Oracle and we also provide all technical courses like Oracle, Java, Data Science, Big data, AWS, Python, etc. with the best trainers receiving the amazing training for the best career. For more details and demo classes call 7504633633.

    ReplyDelete
  25. Incredible post I should say and a debt of gratitude is in order for the data. Schooling is certainly a tacky subject. Be that as it may, is still among the main subjects within recent memory. I appreciate your post and anticipate more. You have made some valid statements there. I looked on the web to study the issue and discovered a great many people will oblige your perspectives on this site...
    how to make a paper airplane eagle | how to make a boomerang airplane | the eagle paper airplane | best paper airplane design for distance and accuracy | best paper airplanes for distance and speed | what is the best paper airplane design for distance | paper airplane that flies far and straight | nakamura lock paper airplane instructions | paper airplane templates for distance | science behind paper airplanes

    ReplyDelete