I\'m trying to execute a function from another component (These 2 components are NOT siblings). My guess is that I will need to use @Output and even
Inheritance the components.
Let's say one component.
@Component({
...
})
export class Component1 {
constructor();
public test1() {
console.log("this is a test");
}
}
you can inheritance the first component as a child an execute the test1 method
@Component({
...
})
export Class Component2 extends Component1 {
constructor();
//Execute test1 method
test1();
}
Also, remember that if you are using angular you need to export your components in the declarations and entryComponents. Also you need to import it in your new component.
import { Component1 } from 'directory/component';
/* Example */
import { SplashScreen } from 'directory/splash-screen';