How 'Brothers & Sisters' alum Dave Annable reacted after he was fired from his new show

PHOTO: Dave Annable arrives for the 17th Emmys Golf Classic on Sept. 2, 2016, in Los Angeles.PlayGabriel Olsen/FilmMagic via Getty Images FILE
WATCH '666 Park Avenue' Star Previews Halloween Special

"Brothers & Sisters" alum David Annable was fired from his new show, but rather than be outraged, he turned the experience into a teachable moment.

The veteran TV actor took to Instagram the day after Deadline broke the news that the CBS military drama "The Code" had been picked up as a series but without Annable and Oscar-winner Mira Sorvino.

Annable, 38, had been cast to play the male lead, with Sorvino in a major co-starring role.

In a lengthy post on Instagram earlier this month, the 39-year-old actor wrote that he got the news that he was being replaced while visiting Disneyland with his family.

"After receiving the call that the show was being picked up and I was being replaced (while I was at Disneyland with my family, ugh) I went to the perspective of the student. What is the lesson here? What can I learn from this experience moving forward?" he said.

To be angry, he said, is to choose the role of victim. "I’m not a victim,” he said. “This is a circumstance. It is my choice and my choice only on how I choose to deal with it.

"To only see this as my loss is limiting and self centered. It’s so much bigger than me," he wrote, adding that he loved the people with whom he worked on the show and wishes them nothing but success.

PHOTO: Sally Field, Calista Flockhart, Rachel Griffiths, Matthew Rhys, and Dave Annable appear in a scence from Brothers & Sisters. Richard Cartwright/ABC
Sally Field, Calista Flockhart, Rachel Griffiths, Matthew Rhys, and Dave Annable appear in a scence from "Brothers & Sisters."

He said he decided to post a screenshot of the Deadline report out of fear. "Fear of embarrassment. Fear of Failure," he wrote. "I’ve never been fired before and certainly not publicly. Right now I want to run. I want to hide. I want to quit. The TOUGHER thing to do is face it. To embrace it."

He continued, "Learning to deal with failure is one of the most important lessons you’ll deal with in your life. Guess what? Failure is mandatory. It’s growth. It’ll never stop."

Annable vowed to lead by example.

"I took one on the chin yesterday but this morning I’m gonna stand tall and hold my head up high because that is what I’m CHOOSING to do. I’m not gonna tell my family what to do, I’m gonna show them. On to the next," he wrote.

He concluded his post with, "Watch my friends crush it on 'The Code' on CBS. Thank you."

Annable's words resonated with many of his fellow actors, who were among those responding in the comments section.

PHOTO: Octavia Spencer attends an event during the 2018 Sundance Film Festival at Filmmaker Lodge on Jan. 23, 2018, in Park City, Utah. Michael Loccisano/Getty Images FILE
Octavia Spencer attends an event during the 2018 Sundance Film Festival at Filmmaker Lodge on Jan. 23, 2018, in Park City, Utah.

Actor Octavia Spencer called him "a king."

"I know from experience how difficult this can be," she wrote. "I also know that God has something bigger in store for you that can’t even imagine. What’s the saying: when one door closes... well, forget that about the doors. Windows have always been my entrance. Love u."

PHOTO: Mira Sorvino attends Kentucky Derby 144 on May 5, 2018, in Louisville, Ky. Michael Loccisano/Getty Images
Mira Sorvino attends Kentucky Derby 144 on May 5, 2018, in Louisville, Ky.

His co-star Sorvino wrote, "You have an amazing positive spirit. I am sorry we won’t be able to work with each other on this one but I thought you rocked, had such strength and charisma, almost old Hollywood- like. I too wish all of our cast mates and the creative team behind it the best as they move forward. And when God closes a door..."

Actor Scott Wolf also cheered his post. "Yes, brother. Yes yes yes yes yes," he wrote. "Sending love to you and your beautiful family. Looking forward to seeing what this has cleared the way for."

PHOTO: Scott Wolf attends Sony Pictures Televisions Q&A on June 12, 2016, in Austin, Texas. Sarah Kerver/Getty Images FILE
Scott Wolf attends Sony Pictures Television's Q&A on June 12, 2016, in Austin, Texas.

The outpouring of support made Annable emotional. "To say that I’m moved by your words is a gross understatement,” he wrote. “I want to thank you guys from the bottom of my heart because you have helped turn this negative into a positive for me."