Note that there are some explanatory texts on larger screens.

plurals
  1. POangularjs (1.2.0) not printing results to page
    primarykey
    data
    text
    <p>I've got an angularjs view that I'm trying to print its results and even though the indexing and console output show the data I can't get it to show up in the actual page.</p> <p>My console output of the json data received:</p> <pre><code>[Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object] 0: Object $$hashKey: "004" _id: Object $oid: "527994c48776385b2e4a6e78" __proto__: Object author: "Undefined author" content: "Undefined content" title: "stfu" __proto__: Object 1: Object $$hashKey: "005" _id: Object $oid: "52799b0a8776385c490cd268" __proto__: Object author: "adam-stokes" content: "some content here" title: "dieeeee" </code></pre> <p>My controller code:</p> <pre><code>'use strict'; var cagewebControllers = angular.module('cagewebControllers', []); cagewebControllers.controller('IndexCtrl', ['$scope', '$http', function($scope, $http) { $http.get('http://localhost:9000/entity/page'). success(function(data, status, headers, config) { $scope.pages = data; console.log($scope.pages); }); } ]); </code></pre> <p>My app code:</p> <pre><code>'use strict'; var cageweb = angular.module('cageweb', [ 'ngRoute', 'cagewebControllers' ]); cageweb.config(['$routeProvider', function($routeProvider) { $routeProvider. » when('/', { » templateUrl: 'partials/index', » controller: 'IndexCtrl' » }). » otherwise({ » redirectTo: '/' » }); }]); </code></pre> <p>my template partial:</p> <pre><code>&lt;h1&gt;Pages&lt;/h1&gt; {{pages.length}} &lt;div ng-repeat="page in pages track by $id(page)"&gt; page {{$$hashKey}} - {{page.title}} &lt;/div&gt; </code></pre> <p>my template layout:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html ng-app="cageweb"&gt; &lt;head&gt; &lt;title&gt;{{ title }}&lt;/title&gt; &lt;link rel='stylesheet' href='/stylesheets/style.css' /&gt; &lt;script src="javascripts/lib/jquery/jquery-1.10.2.min.js"&gt;&lt;/script&gt; &lt;script src="javascripts/lib/angular/angular.js"&gt;&lt;/script&gt; &lt;script src="javascripts/lib/angular/angular-animate.min.js"&gt;&lt;/script&gt; &lt;script src="javascripts/lib/angular/angular-resource.min.js"&gt;&lt;/script&gt; &lt;script src="javascripts/lib/angular/angular-route.min.js"&gt;&lt;/script&gt; &lt;script src="javascripts/app.js"&gt;&lt;/script&gt; &lt;script src="javascripts/controllers.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;cage-webbbbb&lt;/h1&gt; &lt;div class="view-container"&gt; &lt;div ng-view class="view-frame"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>$scope.pages does contain the json data and I can see the data with console.log($scope.pages) but for whatever reason I can not get it to print on the page itself. im not sure if its something easy im missing but a second set of eyes would be much appreciated.</p> <p>thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload