Injection-molded magnets