Cobalt and nickel with various morphologies: mineralizer-assisted synthesis, formation mechanism, and magnetic properties