<apex:componentid="sample_ng_component"selfClosing="true"><apex:outputPanellayout="block"id="root"><!-- EVENTUALLY USE TO GENERATE DEDICATED MODULE/CONTROLLER NAMES -- NO NEED FOR THAT UNTIL NOW (??) --><apex:variablevalue="{!SUBSTITUTE($Component.root, ':', '_')}"var="rootId"/> {!rootId}
<divng-controller="Controller">{{greeting}}<div><labelfor="article_number">#Article number#</label><inputtype="text"name="article_number"id="article_number"autocomplete="off"placeholder="Article number"ng-model="articleNumber"/>{{articleNumber}}</div></div><script>(function(){"use strict";if(typeofangular==="undefined"){varerrMsg="angular.js is required in order to run this component. Refer to <a href=\"https://docs.angularjs.org/misc/downloading\">https://docs.angularjs.org/misc/downloading</a> for further information about installing angular.js in your page.";if(console){console.error(errMsg);}throwerrMsg;}else{// BOOTSTRAP ANGULAR APPvarapp=angular.module('sampleModule',[]).controller('Controller',function($scope,$timeout){$scope.greeting='Welcome!';varpromise=null;$scope.$watch("articleNumber",function(newValue,oldValue){if(newValue===oldValue){return;}if(promise){$timeout.cancel(promise);}promise=$timeout(function(){// CALL DA SERVER HEREVisualforce.remoting.Manager.invokeAction('{!$RemoteAction.blohbloh.blahblah}',$scope.articleNumber,function(){// lala });},500);});});angular.bootstrap(document.getElementById('{!$Component.root}'),['sampleModule']);}})();</script></apex:outputPanel></apex:component>
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.