Angular service

by Amy L

HTML

<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="https://code.angularjs.org/1.4.6/angular.min.js"></script>
<div ng-controller="TestController">
    <p>
        <span class="penguin" ng-show="showDancingPenguin">&lt;('.'&lt;) ^('.')^ (&gt;'.')&gt;</span>
    </p>
</div>

CSS

.penguin {
    font-family: monospace;
    font-size: 30pt;
}

JavaScript

function AngularAdapter(context) {
    var instance = context;
    return {
        getProperty: function() {
            return 'true';
        }
    };
}

var app = angular.module('ionicApp', []);

app.controller('PropertiesController', function ($scope) {
	$scope.getProperty = new AngularAdapter($scope).getProperty;
});

app.controller('TestController', ['$scope','$controller', function($scope, $controller) {
    angular.extend(this, $controller('PropertiesController', { $scope: $scope }));
    $scope.showDancingPenguin = $scope.getProperty('showDancingPenguin') === 'true'; 
}]);