First of all, prepare the tomato sauce. Heat the oil in a frying-pan over a medium heat and sweat the garlic for a few minutes until soft and starting to caramelize. Add the tomatoes, half of the basil and a pinch of sugar. Season with salt. Simmer over a gentle heat for at least 15 minutes.
After the sauce has been simmering for 10 minutes, cook the spaghetti in plenty of boiling salted water and drain al dente, put the spaghetti in a large heat-proof bowl and add the warm tomato sauce. Mix well and let the pasta cool slightly. Slice the mozzarella thinly. Mix the eggs in a bowl with the grated parmesan cheese, salt and pepper and add the eggs to the spaghetti when still slightly warm. Heat the oil in a non-stick, deep frying pan, take it off the heat and add half the egg and pasta mixture, spread the sliced mozzarella over it and then over with the remaining pasta. It should be 4 – 5 cm high. Put the frying pan back on a medium heat and cook the frittata evenly on one side, then slide it onto a lid. Place the frying pan on top of the lid and with one swift move, carefully flip the lid so that the uncooked side is now in the pan, and finish off cooking it until crisp and golden-brown on both sides. The frittata can be served warm but is very good cold.