Sol
6 years agoNew Contributor
Can't have objects methods
Hello!
I have the following trouble.
In Unit 1 I create a class and define its properties and methods.
function MyClass() { this.myProperty; } FileClass.prototype.myMethod = function(){ \\code return result; }
I have written export.
module.exports.MyClass = MyClass;
Now I want to use it in Unit 2.
I connect import.
var MyClassUnit = require("Unit1");
I create an object and use it.
myObject = new MyClassUnit.MyClass(); // do something myObject.myMethod(); // it works
But there is one question: when I write the name of the object and put a dot after it TestComplete (IDE) does not offer me the available methods and attributes, I have to write with my hands, which is inconvenient when there are a lot of methods to constantly look at a Unit1.
How can I solve this problem?
I'm not sure what you're asking... another way to do what? Get a Code Completion to popup on objects instantiated on classes declared in another unit? Not really, no.