I have noticed that my junior developer is injecting app component to another components to update state and call methods from another components. I told her that it is not angular way,use subjects instead.iam also feeling that sometimes injecting components is far easier than using subjects.i have not find any posts explaining why this method is not encouraged?
Her code looks like
import { ExampleComponent } from './../example/example.component';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
constructor(example:ExampleComponent){
example.getAllUsers()
}
}