Nigeria's Flamingos won the FIFA U-17 Women's World Cup for the first time, beating Japan 2-1 in the final in Rabat, Morocco.