Created
June 14, 2018 11:49
-
-
Save edlvj/c2291d613386ea56c1773a61c0a52d03 to your computer and use it in GitHub Desktop.
resource
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
//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