Checking if name attribute exists in the link function instead of the compile function