Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exists: boolean; //here's the variable declaration at the beginning of the class
- onCreateFolder(nodeId) { //the actual function
- this.exists = false;
- this.nodeService.getNodeChildren(nodeId).forEach(
- node => {
- node.list.entries.forEach(
- actualNode => {
- if(actualNode.entry.isFolder && actualNode.entry.name === theName) {
- this.exists = true;
- this.existingFolderId = actualNode.entry.id;
- console.log("Found the existing folder! " + this.existingFolderId); //console log is beeing printed - so the if statement is true at least once so as this.exists should be set to true
- }
- }
- )
- }
- )
- //after leaving the method above the it seems like this.exists goes back to false(?)
- if(!this.exists) {
- //always get into
- } else if(this.exists) {
- //never get into
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement