1. An LED tube lamp, comprising:a tube;
an LED light strip disposed inside the tube;
a plurality of LED light sources mounted on the LED light strip;
a power supply comprising a circuit board, a plurality of electronic components and a heat-dissipating element, wherein at least a part of the plurality of electronic components and the heat-dissipating element are on the circuit board; and
a first end cap and a second end cap respectively attached at two ends of the tube, each of the first and second end caps comprising a lateral wall and an end wall having an opening, the lateral wall substantially coaxial with the tube and connected to the tube, the end wall substantially perpendicular to an axial direction of the lateral wall and connected to an end of the lateral wall away from the tube,
wherein the circuit board is inside the first end cap, and the heat-dissipating element is disposed closer to the opening on the end wall of the first end cap than are the plurality of the electronic components disposed in the first end cap.