Closed IngwiePhoenix closed 8 years ago
if (controller instanceof [BIRD3BaseController class]) {
}
Or if you just need to check if it's an oj object or class:
if (oj.isObject(controller)) {
// True if controller is an oj instance, or an oj class
}
That second one was exactly what i wanted! :)
I use ES6/JSX now, but I am writing my controllers using OJ. So from within my app router, I want to verify if the obtained object is actually a OJ class, or at least instance.
Consider this example:
As you see, I either have my classes written in JSX or OJ. So I need to see if the exported class is from OJ or JSX. What would be a good way to do so?