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
app = angular.module('MyApp', []); | |
app.controller('MyCtrl', ['$scope', function ($scope) { | |
$scope.model = { | |
test : 'hello' | |
}; | |
$scope.submitForm = function () { | |
alert('Dirty: ' + $scope.theForm.$dirty); |
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> | |
<head> | |
<title></title> | |
</head> | |
<body ng-app="MyApp" ng-controller="MyCtrl"> | |
<form name="theForm" action="newpage.html" method="post"> | |
<input type="text" ng-model="model.test"/> | |
</form> |
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
// cell-template.html | |
<div ng-cell-has-focus ng-dblclick="editCell()"> | |
<div class="ngCellText">{{getRankName(model.crew[row.rowIndex].rankID)}}</div> | |
</div> | |
//cell-edit-template.html | |
<div> | |
<select | |
ng-model="model.crew[row.rowIndex].rankID" | |
ng-options="rank.rankID as rank.rankName for rank in model.ranks" |
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
'use strict'; | |
describe('Unit: Testing app', function () { | |
var enterprise, | |
enterprise2, | |
deps, | |
hasModule = function (m) { | |
return deps.indexOf(m) >= 0; | |
}; |
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
basePath = ''; | |
files = [ | |
JASMINE, | |
JASMINE_ADAPTER, | |
// 3rd-party | |
'../app/lib/angular-1.1.4.js', | |
'lib/angular-mocks.js', |
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
app.factory('dialog', ['$rootScope', '$dialog', function ($rootScope, $dialog) { | |
$rootScope.$on('alert', function (event, data) { | |
console.log('alert function:', event.name, data); | |
/** data should have: | |
- title, message and optionally, a callback | |
*/ |
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
$httpProvider.defaults.transformRequest = function (data) { | |
if (data) { | |
return $.param(data); | |
} | |
}; |
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
<cfheader name="Access-Control-Allow-Origin" value="*" /> | |
<cfoutput>Content-Type: #GetHttpRequestData().headers['Content-Type']#</cfoutput> | |
<cfoutput>cgi.request_method=#cgi.request_method#</cfoutput> | |
<cfoutput>FORM: #serializeJSON(form)#</cfoutput> | |
<cfoutput>URL: #serializeJSON(url)#</cfoutput> |
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
service.post = function (data) { | |
$http({ | |
method : 'POST', | |
url : CFGATEWAY, | |
data : data | |
}) | |
.success(function (data, status, headers, config) { | |
console.log('Post OK!!!', data); | |
$rootScope.$broadcast(name + '.success', data); | |
}) |
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
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; |
NewerOlder