A metatable can be defined like
local t = setmetatable({}, {
__tostring = function() return 'custom tostring behavior!' end
})
Here are the metamethods that you can define, and their behavior
public static void Register(HttpConfiguration config) | |
{ | |
config.Services.Add(typeof(System.Web.Http.ValueProviders.ValueProviderFactory), | |
new EmptyValueProviderFactory()); | |
} | |
public class EmptyValueProvider : System.Web.Http.ValueProviders.IValueProvider | |
{ | |
public bool ContainsPrefix(string prefix) | |
{ |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |