ANAHEIM, Calif. — Joe Girardi thought Friday night was as good an opportunity as any for the next step of Gary Sanchez’s development.

He caught staff ace Masahiro Tanaka and his vast array of pitches for the first time — and it could not have gone much better for either of them.

Tanaka was as dominant as he’s been all season, striking out nine in 7 2⁄3 innings, and Sanchez had two doubles, a single, a walk and a stolen base as the Yankees cruised to a 7-0 victory over the Angels in front of 40,256 at Angel Stadium.

Said Girardi, “I thought it was important because he really hadn’t caught him much, maybe in a spring training game, I don’t remember. For them to be able to work that well together I think is good. Because that’s the thing for a young catcher; you want to feel you’re on the same page with everyone and it’s not always so easy, and I thought they did a really good job tonight.”

Tanaka said through a translator: “I think he had a really good idea going into the game of how to call the game, and I think he did a really good job. Sometimes I did shake him off, but overall, I think he did an excellent job.”

advertisement | advertise on newsday

And Sanchez said through his translator, “The key here when you catch a pitcher that you’ve never caught in a big-league game is the preparation before the game. We got together before the game, we put together a plan and it worked out very well for us.”

In the opener of a six-game West Coast trip, the Yankees (62-59) had 15 hits, including home runs by Jacoby Ellsbury, Ronald Torreyes — who had a career-high four hits — Didi Gregorius and Brian McCann.

The latter three came in the fifth inning against slop-throwing righty Jered Weaver, who entered the night 8-10 with a 5.32 ERA and left after 4 2⁄3 innings. He allowed five runs and 10 hits, including the four homers.

Sanchez, who batted third, has 11 hits in his last 22 at-bats and is 21-for-50 (.420) since his call-up.

Tanaka, who came in 9-4 with a 3.40 ERA but 2-2 with a 5.55 ERA in his previous four starts, gave up five hits and no walks.

Yankees videos

Tanaka retired the first 11 he faced, striking out the side in the first inning en route to recording six strikeouts through five innings. He departed with two on and two out in the eighth, giving way to lefty Tommy Layne, who walked Kole Calhoun to load the bases for Mike Trout. In came Adam Warren, who struck out Trout looking.

Girardi found his stomach turning an inning earlier, again courtesy of Trout. The centerfielder led off the seventh with a ground smash off Tanaka’s right foot. Tanaka, who had retired seven straight at that point, threw one practice pitch in front of Girardi and trainer Steve Donohue to show he was OK and promptly retired three straight to end the inning.

Said Tanaka, “I think my fastball was really good tonight, so because of having that good fastball, my secondary pitch, the splitter, was working well.”

What most impressed Sanchez about Tanaka? “It’s hard to pick one thing because everything was working for him today,’’ he said. “The pitches were breaking, the location was amazing, so I would say everything.”

The Yankees gave Tanaka a lead before he stepped on the mound. Ellsbury, coming off a 2-for-20 homestand, led off by driving a 1-and-1 fastball into the rightfield seats for the first of his three hits. It was his first homer since July 10 and the Yankees’ first leadoff homer of the season.

advertisement | advertise on newsday

Torreyes — who started at third base in place of Chase Headley, out with a sore left Achilles — started the third by lining a double down the leftfield line and Ellsbury singled to right to make it 2-0.

The 5-10, 150-pound Torreyes got the fifth-inning power display started, leading off with his first career homer, a bomb into the bullpen area in left-center. Torreyes, exceedingly popular in the clubhouse, was mobbed in the dugout, with the Yankees reacting as if the homer had won the game.

Torreyes, whose home run was predicted in the dugout by Starlin Castro before he came up for the at-bat, said of the blast: “It’s a really nice feeling when you hit your first home run, but the second thing about that is I’m helping the team. That’s why I was so pumped up.”

Gregorius’ 17th homer later in the inning made it 4-0 and McCann’s 16th made it 5-0.

Torreyes singled home a run and scored on Gregorius’ ground-rule double in the sixth for a 7-0 lead.

advertisement | advertise on newsday

Said Torreyes, “My job is to come to the ballpark ready to play. Although I don’t play every day, once I get the opportunity to play, I want to do my best. Tonight, I got results and I’m very happy we won the game.”