Cody (1-1) allowed just three hits and one run in a career-high five innings, striking out five without a walk. He retired 11 straight before Chris Woodward went to the bullpen.
The 26-year-old rookie exited with a 1.53 ERA in seven big league games, including four starts.
Julio Teheran (0-4) was chased in the second inning for the second consecutive game.
Gallo hit a two-run homer off Teheran in the first and Tejada had a leadoff drive in the second. Teheran has given up 12 home runs in 30 1/3 innings this season.
Huff, the 22-year-old catching prospect who made his big league debut earlier this month, hit his first career home run, a 410-foot shot in the fourth to left-center field off a rock in the water fountain.
Patrick Sandoval pitched 4 1/3 innings of solid relief for the Angels, with his only blemish the homer to Huff. He kept the Angels close but Odor and Dietrich homered off reliever Ty Buttrey in the eighth.
Rangers: INF Ronald Guzman left the game with tightness in his right hamstring after he tried to run out a grounder to first.
Angels: INF Franklin Barreto will have shoulder surgery this week, according to Joe Maddon … OF Upton, who was hit in the helmet on Friday and left the game, was back in Sunday’s lineup.
Rangers: RHP Kyle Gibson (2-5, 5.18) is coming off one of the best starts of his career, throwing a complete game shutout in Texas’ 1-0 win over Houston. He struck out nine and allowed just four hits in the win.
Angels: RHP Dylan Bundy (5-3, 3.12) is 4-1 with a 2.61 ERA in eight career appearances against the Rangers. He ranks sixth among American League pitchers with a 1.01 WHIP.
The Rangers acquired minor league RHP Stephen Villines from the Mets to complete the Aug. 5 trade that sent RHP Ariel Jurado to New York.