Thanks for your question.
Non-EEA family members of EEA nationals can retain their right of residence in some circumstances
Under the Immigration (European Economic Area) Regulations 2006 you will retain a right of residence in this country (ie. a right to stay and work) if
1. the marriage or partnership lasted for at least three years immediately before the initiation of proceedings for divorce, annulment or dissolution, and
2. the parties to the marriage or civil partnership had resided in the UK for at least one year during the duration of the marriage or civil partnership
This is provided that:-
a) You are a non-eea national but are pursuing an activity which would make you a worker/self-employed person if you were an eea-national,
b) You are a self-sufficient person
Provided you are pursuing what would be your treaty rights if you were an eea-national (ie. working) you will retain your right of residence and could apply to have this acknowledged by the UKBA.
If this has been useful please kindly click accept so that I may be rewarded for my time. It will be gratefully received and you will be free to ask follow up questions.