Created
July 6, 2016 19:22
-
-
Save cemersoz/223297d7decb8c578a5f925163df9e26 to your computer and use it in GitHub Desktop.
meteor error 404 method not found
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
// Meteor Imports | |
import { Meteor } from 'meteor/meteor'; | |
import { Mongo } from 'meteor/mongo'; | |
import 'reflect-metadata'; | |
import 'zone.js/dist/zone'; | |
// Angular Imports | |
import { Component, ViewEncapsulation, provide } from '@angular/core'; | |
import { bootstrap } from 'angular2-meteor-auto-bootstrap'; | |
// Angular Material Imports | |
import { MeteorComponent } from 'angular2-meteor'; | |
// Terminal and Markdown Imports | |
import { Terminal } from "../../components/wetty/terminal"; | |
import { MarkdownView } from "../../components/markdown/markdown"; | |
// Meteor method imports | |
import { createLab } from "../../../lab/methods.ts" | |
// Define TaskView Component | |
@Component({ | |
selector: 'tuxlab-taskview', | |
templateUrl: '/client/imports/ui/pages/lab/taskview.html', | |
directives: [ MarkdownView ] | |
}) | |
export class TaskView extends MeteorComponent{ | |
constructor() { | |
super(); | |
createLab.call({courseId: '5', labId: 1},(err,res) => {console.log(err,res)}); | |
} | |
} |
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
declare var SimpleSchema : any; | |
export const createLab = { | |
name: 'createLab', | |
//validate parameters | |
validate(args){ | |
new SimpleSchema ({ | |
courseId: { type: String }, | |
labId: { type: Number } | |
}).validate(args) | |
}, | |
run({courseId, labId}){ | |
console.log("this is working"); | |
return "and also this" | |
}, | |
call(args, callback){ | |
const options = { | |
returnStubValue: true, // (5) | |
throwStubExceptions: true // (6) | |
} | |
Meteor.apply(this.name,[args],options,callback); | |
} | |
}; | |
Meteor.methods({ | |
[createLab.name]: function(args){ | |
createLab.validate.call(this,args); | |
createLab.run.call(this,args); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment