+ Start a Discussion
Salesforce 283Salesforce 283 

i would like to display the list of records in page using angular js

Hi Guys,

I have written the simple code mentioned below. I don't know why it is displaying the records. Please help me on this.

<apex:page controller="AngularJS_Page2" docType="html-5.0" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="true" cache="false">
  <meta charset="utf-8"/>
 <!-- <apex:includeScript value="{!URLFOR($Resource.AngularJS, '/lib/angular.js')}"/>
  <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js" />-->
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.0/angular.min.js"/>
    <div ng-app="myapp"  ng-controller="mycontroller">
   <tr ng-repeat="Acc in Accounts">
    <td ng-bind="Acc.name"></td>
    <td ng-bind="Acc.phone"></td>
 var app=angular.module('myapp',[]);
    $scope.Accounts = {!Accountslist};

Apex Class:

public with sharing class AngularJS_Page2 {

    public String getAccountslist() {
        return JSON.serialize([select id,name,phone from account]);

Thanks in Advance.