Skip to content

Instantly share code, notes, and snippets.

View gajus's full-sized avatar

Gajus Kuizinas gajus

View GitHub Profile
<div class="row" ng-controller="main">
<ul>
<li ng-repeat="screen in screens" ng-class="{'active': screen == currentScreen}"
ng-click="setScreen($index)"
class="button">{{screen}}</li>
</ul>
</div>
<div ng-include="getScreenView()"></div>
<div class="row" ng-controller="main">
<ul>
<li ng-repeat="screen in screens" ng-class="{'active': screen == currentScreen}"
ng-click="setScreen($index)"
class="button">{{screen}}</li>
</ul>
</div>
<div ng-include="getScreenView()"></div>
angular.module('storeAdmin')
.controller('main', function ($scope) {
$scope.screens = ['Product', 'Order'];
$scope.currentScreen = $scope.screens[0];
$scope.setScreen = function (index) {
$scope.currentScreen = $scope.screens[index];
};
$scope.getScreenView = function () {
angular.module('storeAdmin')
.controller('main', function ($scope) {
$scope.screens = ['Product', 'Order'];
$scope.currentScreen = $scope.screens[0];
$scope.setScreen = function (index) {
$scope.currentScreen = $scope.screens[index];
};
$scope.getScreenView = function () {
var foo = function () {}; foo['bar'] = 'baz'; foo['bar'];
<!DOCTYPE html>
<html ng-app="example">
<head>
<title></title>
<script src="./static/js/angular.js"></script>
<script src="./static/js/modules/example.js"></script>
<script src="./static/js/controllers/date.js"></script>
<link rel="stylesheet" type="text/css" href="./static/css/main.css">
editoreditoreditor
editoreditoreditoreditoreditoreditoreditoreditoreditor
editoreditoreditor
editoreditoreditoreditoreditoreditoreditoreditoreditor
mochaApp.controller('DashboardController', ['$scope', 'api', 'util',
function ($scope, api, util) {
api.getGrossSales(null, function(err, data) {
// Just call util.whatever();
$scope.getGrossSales = data;
$('span#gross-sales-value').text(data.gross_sales);
});
.....
function Drag (subject) {
var dative = this,
handle,
dragClickOffsetX,
dragClickOffsetY,
lastDragX,
lastDragY;
subject.draggable = true;