Update directives.js

Fix the bug that duplicate items in a list after delete a item