It is not valid it was sweared while you were angry . You can eat for your knowledge read the following ruling of Aagha e Sistani
2680. The conditions for validity of an oath are:
A person who takes an oath should be Baligh and sane, and should do so with free will and clear intention. Hence, an oath by a minor, an insane person, an intoxicated person, or by a person who has been coerced to take an oath, will not be in order. Similarly, if he takes an oath involuntarily, or unintentionally, in a state of excitement, the oath will be void. An oath taken for the performance of an act which is haraam or makrooh, is not valid. Similarly, an oath for renouncing an act which is obligatory or Mustahab is also void. And if he takes an oath to perform a normal or usual act, it will be valid, if that act has any preference in the estimation of sensible people. Similarly, if he takes an oath for renouncing a usually permissible act, it will be valid if it is deemed more preferable than its performance, by the sensible people. In fact, in each case, his own judgement about the preferences will be enough to grant validity to the oath, even if other sensible people may not concur. The oath must be sworn by one of those names of the Almighty Allah which are exclusively used for Him, (e.g. 'Allah'). And even if he swears by a name which is used for other beings also, but is used so extensively for Him, that when any person utters that name one is reminded of Him Alone, for example, if he swears by the name Khaliq (the Creator) and Raziq (the Bestower), the oath will be in order. In fact, if he uses other names or attributes of Allah, which do not remind of Him, but give that connotation when used during an oath, like Samee' (All Hearing) or Baseer (All Seeing), even then the oath will be valid. The oath should be uttered in words, but a dumb person can take an oath by making a sign. Similarly, if a person is unable to utter the words, he may write down the oath, repeating in his mind the intention for it, that will be a valid oath, though as a precaution, he may confirm the oath in other ways as well. It should be possible for him to act upon his oath. And if he was able to act upon the oath when he took it, but became incapable of acting upon it later, the oath becomes nullified from the time he became incapable of acting upon it, provided that he did not incapacitate himself purposely. And the same rule applies if acting upon one's vow, oath, or covenant, involves unbearable hardship.