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
using System; | |
using System.Diagnostics; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
const string PostcodeSubstitute = "PJ15 8JJ"; | |
const string MatchingPostcode = "PJ15 8QJ"; |
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
// for every module you include here, you need to add required resource files into your test file | |
var app = angular.module('app', ['ngSanitize', 'ngResource', 'ngRoute']); | |
// definition of controller | |
'use strict'; | |
app.controller('AdminCtr', | |
function AdminCtr() { | |
this.helpAndSupportText = 'Hello'; | |
}); |
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 example: <my-button> | |
testApp.directive('myButton', function(){ | |
return { | |
link: function (scope, element, attrs) { | |
var markup = "<button>Hello</button>"; | |
element.prepend(markup); // adds html before any child | |
element.append(markup); // adds html after last child | |
} | |
} |
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
// used in: http://blog.cpodesign.com/blog/angular-directives-in-examples/ | |
// use example: <my-button> | |
testApp.directive('myButton', function(){ | |
return { | |
link: function (scope, element, attrs) { | |
var markup = "<button>Hello</button>"; | |
element.prepend(markup); // adds html before any child | |
element.append(markup); // adds html after last child | |
} |
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.controller('myController', function($scope){ | |
$scope.teams = [ | |
{id:1, name:'team 1'}, | |
{id:2, name:'team 2'}, | |
{id:3, name:'team 3'}]; | |
// if I want to preselect item I can do following | |
// $scope.myTeam = 1; | |
}); |
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
var app = angular.module('app', ['ngRoute','ng-breadcrumbs']); | |
app.config(function($routeProvider) { | |
$routeProvider.when('/', | |
{ | |
templateUrl: 'templates/list.html', | |
controller: 'listCtr', | |
label:'Administration' | |
}) | |
.when('/detail/', |
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 with parameters | |
// How do I not send url template parameters with request body in angular? | |
// Source: http://stackoverflow.com/questions/19529483/how-do-i-not-send-url-template-parameters-with-request-body-in-angular | |
resource = $resource( | |
'http://foo.com/service/:type/:id', | |
{}, | |
{save: { | |
method:'PUT', | |
transformRequest:function(data) { | |
delete data.type; |
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
<p> | |
Implementation of loader in $rootScope | |
</p> | |
<div style="float:right;padding-top:1em;" data-ng-show="loading"> | |
<img src="~/images/ajax-loader-inline.gif" /> Loading, please wait ... | |
</div> |
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
.directive("notificationBar", function () { | |
return { | |
transclude: false, | |
require: '^ngModel', | |
templateUrl: 'notificationBar/template.html', | |
scope: { | |
displayMessage: '@' | |
}, | |
controller: function ($scope){ | |
$scope.showMessage = function() { |
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
var app = angular.module('app', []); | |
app.controller('priorityCtr', | |
function priorityCtr($rootScope, $scope){ | |
$scope.showError = function(){ | |
$rootScope.errorMessage='test error message'; | |
$rootScope.successMessage=''; | |
$rootScope.warnMessage=''; | |
}; |
OlderNewer