Skip to content

Instantly share code, notes, and snippets.

@edlvj
Created June 14, 2018 11:49
Show Gist options
  • Save edlvj/c2291d613386ea56c1773a61c0a52d03 to your computer and use it in GitHub Desktop.
Save edlvj/c2291d613386ea56c1773a61c0a52d03 to your computer and use it in GitHub Desktop.
resource
//HelpContent.js
module.exports = function (HelpContent) {
HelpContent.test = function() {
return true;
}
}
//HelpContent.json
{
"name": "HelpContent",
"base": "PersistedModel",
"idInjection": true,
"injectOptionsFromRemoteContext": true,
"options": {
"validateUpsert": true
},
"mixins": {
"TimeStamp": {
"required": false
}
},
"properties": {
"title": {
"type": "string"
},
"text": {
"type": "string"
},
"video": {
"type": "object",
"default": {},
"postgresql": {
"dataType": "text",
"nullable": "NO"
}
}
},
"validations": [],
"relations": {
"channels": {
"type": "belongsTo",
"model": "Channel",
"polymorphic": {
"as": "resourceble",
"foreignKey": "resourcebleId",
"discriminator": "resourcebleType"
}
},
"courses": {
"type": "belongsTo",
"model": "Course",
"polymorphic": {
"as": "resourceble",
"foreignKey": "resourcebleId",
"discriminator": "resourcebleType"
}
}
},
"acls": [],
"methods": {}
}
//HelpContentService.js
(function () {
'use strict';
angular
.module('winePortal')
.service(
'HelpContentService',
function (HelpContent)
{
//return always TypeError: HelpContent.test is not a function
console.log(HelpContent.test());
}
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment