JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.angularjs.org/1.0.0rc4/angular-1.0.0rc4.min.js"></script>
<div ng-app='app'>
<div ng-controller="TestCtrl">
<p>{{ get() }}</p>
</div>
<div ng-controller="TestCtrlWontDisplay">
<p>{{ get('rdfs:label') }}</p>
</div>
</div>
JavaScript
var app = angular.module('app', [])
function TestCtrl($scope /*, GraphManager */ ) {
// Use a Service (GrpahManager) to load the turtle data, parse it using rdf.js
$scope.times = 0;
$scope.get = function(property) {
// use rdf graph to get data
// e.g.
// val = graph.match("aUri", property, null).toArray()[0].object.toString()
// With the service it would look like :
// val = GraphManager.get(property)
$scope.times++;
console.log("TestCtrl I'm here " + $scope.times);
return "TestCtrl val - value extracted from rdf graph";
}
}
function TestCtrlWontDisplay($scope /*, GraphManager */ ) {
// Use a Service (GrpahManager) to load the turtle data, parse it using rdf.js
$scope.times = 0;
$scope.get = function(property) {
if ($scope.times > 0) return;
// use rdf graph to get data
// e.g.
// val = graph.match("aUri", property, null).toArray()[0].object.toString()
// With the service it would look like :
// val = GraphManager.get(property)
$scope.times++;
console.log("TestCtrlWontDisplay I'm here " + $scope.times);
return "wont display";
}
}