+ Start a Discussion

how to include angular js 6 with Salesforce visualforce

I need to use the angular 6 with salesforce visualforce . Is that possible
Parmanand PathakParmanand Pathak
Follow the below references - 

Include the  CDN of AngularJs  in your VF  page and then use the library according to your requirement.

Mark it as best answer if it helps you.

Parmanand Pathak
Paul BarberPaul Barber
I think this question is about Angular 6 and not AngularJS.
yes angular 6
santosh latpate 5santosh latpate 5
Does anyone got the answer for this. I am also searching for the same. Does anyone know how to use angular 6 on salesforce visualforce page.
Vineeta Sharma 7Vineeta Sharma 7
Hi, Here is solution of your question you can easily combine angular js with salesforce visualforce using the given code
Using this code you can find all the opportunities records related to particular account by providing account id.

<apex:page standardStylesheets="false" sidebar="false"
   showHeader="false" applyBodyTag="false" applyHtmlTag="false"
   docType="html-5.0" controller="AngularDemoController">
<html lang="en" ng-app="demoApp">
   <meta charset="utf-8"/>
   <meta name="viewport" content="width=device-width, initial-scale=1"/>
   <title>Angular </title>
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"/>
   <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js"></script>
     // define the app
     var demoApp = angular.module('demoApp', []);
     // add the controller
     demoApp.controller('DemoCtrl', function ($scope) {
         $scope.account = {!account}
         $scope.opportunity = {!opportunity}
<body class="container" ng-controller="DemoCtrl">
   <h1 style="color:Green">{{account.Name}}</h1>
   <p class="lead" style="color:Gray">
   {{account.BillingCity}}, {{account.BillingState}}
    <b>Search</b>&nbsp;&nbsp;&nbsp;<input ng-model="query" /><br/><br/>
   <table class="table table-bordered">
     <tr ng-repeat="opportunity in opportunity | filter:query">          

AngularDemoController  is the controller class for the given visualforce code

global with sharing class AngularDemoController {


   // hardcode an account id for demo purposes
   static String accountId = '0010o00002BlG17AAF';
   global static String getAccount() {
       return JSON.serialize([select name, billingstreet,
           billingcity, billingstate, billingpostalcode
           from account where id = :accountId][0]);
   global static String getOpportunity() {
        return JSON.serialize([select id, name, email__c,amount,ExpectedRevenue
           from opportunity where accountId = :accountId]);

Ajay K DubediAjay K Dubedi
Hi Jane,
please visit below link:
here you will come to about all advantage and limitations

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Ajay Dubedi
Deepali KulshresthaDeepali Kulshrestha
Hi Jane,

In this post, I am going to share the information about how you can use Angular JS with Visualforce to display records onto your Visualforce Page.
Please refer the links given below, that may be helpful to you:

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha.
NagaSudheer Kamepalli 4NagaSudheer Kamepalli 4
Hii vineeta sharma7
In your code working fine but in Opportunity we have required fileds CloseDate and Stage