fix angular apply error and adds RTL support