Posts

Showing posts from August, 2018

Convert a normal Git repository to a bare repository.

Replace the contents of your_current_repo  with the contents of your_current_repo/.git , then tell the repository that it is now a bare repository. To do this, execute the following commands: cd your_current_repo mv .git ../your_current_repo.git # renaming just for clarity cd .. rm -fr repo # delete the non-bare repository i.e. your_current_repo cd your_current_repo.git git config --bool core.bare true

Angular 6 LifeCycle hooks / events are not being called.

If lifecycle hooks of your Angular 6 application are not being called then check whether your functions are using arrow function syntax. I have this issue and after some googling i found the solution. The issue is that I was using the arrow function syntax ( => ) like this: class MyComponent implements OnInit { public ngOnInit = () => { console . log ( "ngOnInit" ); } } Apparently that does not work in Angular 6. Using non-arrow function syntax fixes the issue: class MyComponent implements OnInit { public ngOnInit () { console . log ( "ngOnInit" ); } }