Created
March 3, 2016 20:08
Revisions
-
planetsizebrain created this gist
Mar 3, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> <%@ taglib uri="http://liferay.com/tld/theme" prefix="theme" %> <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> <portlet:defineObjects /> <theme:defineObjects /> <div id="<portlet:namespace />app" class="co-app"> <table ng-controller="listCtrl" id="listCtrl"> <thead> <tr> <th>Date</th> </tr> </thead> <tbody> <tr ng-repeat="data in alldata"> <td>{{data.effectiveDateTime}}</td> </tr> </tbody> </table> </div> <aui:script use="aui-base" position="inline"> var app = angular.module('<portlet:namespace />', []); app.factory("services", ['$http', function($http) { var serviceBase = '/angular-hello-world-portlet/data/local.json'; var obj = {}; obj.getData = function() { return $http.get(serviceBase) } return { getData: obj.getData } }]); app.controller('listCtrl', function($scope, services) { services.getData().then(function(data) { $scope.alldata = data.data; }); }); angular.bootstrap(document.getElementById('<portlet:namespace />app'), ['<portlet:namespace />']); </aui:script>