Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit b6fe020

Browse files
committed
Update TIPS-AND-TRICKS.md
1 parent 95f653f commit b6fe020

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

TIPS-AND-TRICKS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ The point of putting the logged in user in the top-level (`authentication state`
2525
Apps that don't let you access their content without being logged in don't have to deal with this use-case. Otherwise, `$state.reload()` or `$state.go('...', {}, { reload: true })` are your friends.
2626

2727
#### Don't use `controllerAs` in routes. Use it in directives only.
28+
_pasted from slack_
29+
2830
controller instances are not shareable. Meaning if you put logic into a controller (`this.doSomething()`) although you can reuse the logic elsewhere, you can’t reuse the instance
2931
controllerAs syntax fixes a few issues, but I believe it will mislead people into thinking it’s okay to bloat controllers, which it isn’t (except for directives)
3032
the reason is because your special logic that’s usually stateful shouldn’t be in the controller, it should be in something stateful that can be shared

0 commit comments

Comments
 (0)