We experimentally investigate the alternative generation of dissipative solitons (DSs) or noise-like pulses (NLPs) from a passively mode-locked Er-doped all-fiber laser with a 45° tilted fiber grating (45° TFG). The 45° TFG serves as an in-fiber polarizer for mode locking in the all-fiber laser cavity. Under the fixed orientations of the polarization controllers, flexible generation between DSs and NLPs can be precisely controlled by adjusting the pump power only. To the best of our knowledge, the total cavity length 4.92 m of our fiber laser is the shortest one among all NLP fiber lasers. We obtain the DS with 3 dB bandwidth of 20.4 nm centered at 1577 nm and the NLP with 3 dB bandwidth of 25.2 nm centered at 1574 nm. The fundamental repetition rate of the mode-locked pulses is 42.3 MHz. This DS-NLP switchable Er-doped fiber laser can be regarded as a multifunctional optical source for diverse practical and potential applications.