Created
April 8, 2011 19:04
-
-
Save keturn/910507 to your computer and use it in GitHub Desktop.
trying to use angular
This file contains 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 characters
<!doctype html> | |
<html xmlns:ng="http://angularjs.org"> | |
<head> | |
<title>all plans</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<link rel="icon" href="/s/plans/images/plans-icon.png?68f34ebf0f" /> | |
<link rel="stylesheet" href="/s/jquery-ui-css/jquery-ui-1.8.9.css?9f6e6ea563" type="text/css" charset="utf-8"/> | |
<link rel="stylesheet" href="/s/jquery-ui-css/jquery-ui-1.8.9.custom.css?7ea76fa98c" type="text/css" charset="utf-8"/> | |
<link rel="stylesheet" type="text/css" href="/s/plans/css/plans.css?9fbd065898"> | |
<link rel="stylesheet" type="text/css" href="/s/plans/css/datatables.css?396b174e7a" /> | |
<!-- Support Files --> | |
<script src="/s/jquery142.all.js?6ae81b7e34" type="text/javascript"></script> | |
<script src="/s/jquery-ui-1.8.9.custom.min.js?1f8cfeffe7"></script> | |
<script src="/s/plans/js/jquery.jeditable.js?f0b2d2ec92"></script> | |
<script src="/s/plans/js/jquery.dataTables-1.7.1.js?b1c26147e1"></script> | |
<script src="/s/plans/js/keytable.js?2e365f9a39"></script> | |
<script src="/s/base.js?4bf7791c54" type="text/javascript"></script> | |
<script src="/s/plans/js/date.js?693cbb2a3d"></script> | |
<script src="/s/angular-0.9.14/angular-0.9.14.js?19c7469c8a"></script> | |
<!-- Plans-specific code --> | |
<script src="/s/plans/js/jeditable.autocomplete.js?1b07ddc92d" ></script> | |
<script src="/s/plans/js/ngplans.js" type="text/javascript"></script> | |
<!-- Do redraw --> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
// planList is normally filled in by the server | |
var planList = [{"name": "picka name", "id": 1191, "taskCount": 0, "openTaskCount": 0, "projectmanager": null, "accountmanager": null, "programmer": null, "description": null}, {"name": "picka name", "id": 1192, "taskCount": 1, "openTaskCount": 1, "projectmanager": null, "accountmanager": null, "programmer": null, "description": null}, {"name": "picka name", "id": 1193, "taskCount": 1, "openTaskCount": 1, "projectmanager": null, "accountmanager": null, "programmer": null, "description": null}, {"name": "picka name", "id": 1194, "taskCount": 1, "openTaskCount": 1, "projectmanager": null, "accountmanager": null, "programmer": null, "description": null}, {"name": "picka name", "id": 1195, "taskCount": 2, "openTaskCount": 2, "projectmanager": null, "accountmanager": null, "programmer": null, "description": null}, {"name": "picka name", "id": 1196, "taskCount": 1, "openTaskCount": 1, "projectmanager": null, "accountmanager": null, "programmer": null, "description": null}, {"name": "picka name", "id": 1197, "taskCount": 0, "openTaskCount": 0, "projectmanager": null, "accountmanager": null, "programmer": null, "description": null}, {"name": "picka name", "id": 1198, "taskCount": 1, "openTaskCount": 1, "projectmanager": null, "accountmanager": null, "programmer": null, "description": null}, {"name": "picka name", "id": 1199, "taskCount": 1, "openTaskCount": 1, "projectmanager": null, "accountmanager": null, "programmer": null, "description": null}, {"name": "the dark side", "id": 1149, "taskCount": 0, "openTaskCount": 0, "projectmanager": null, "accountmanager": null, "programmer": null, "description": "add description here"}, {"name": "picka name", "id": 1200, "taskCount": 1, "openTaskCount": 1, "projectmanager": null, "accountmanager": null, "programmer": null, "description": null}]; | |
var scope = angular.scope(); | |
var config = scope.$service("config"); | |
config.set(planList); | |
angular.compile(document); | |
}); | |
</script> | |
</head> | |
<body id="plans-body"> | |
<div id ="mainPlanContainer" ng:controller="plans.PlanListController"> | |
<p>Plan list follows:</p> | |
<pre>{{ planList }}</pre> | |
<table id="planList" > | |
<tr ng:repeat="plan in planList"><td>{{plan.name}}</td></tr> | |
</table> | |
</div> | |
</body> | |
</html> |
This file contains 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 characters
plans = (function () { | |
var exposed = {}; | |
var PlanListController = function (planList) { | |
this.planList = planList.get(); | |
console.log("PlanListController initialized"); | |
console.log(planList); | |
}; | |
PlanListController.$inject = ["config"]; | |
var Config = function () { | |
this.planList = null; | |
}; | |
Config.prototype.set = function (planList) { | |
this.planList = planList; | |
}; | |
Config.prototype.get = function () { | |
return this.planList; | |
}; | |
angular.service('config', function () { return new Config(); }); | |
exposed.PlanListController = PlanListController; | |
return exposed; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment