  We propose simple models with a flavor-dependent global $U(1)_\ell$ and a
discrete $\mathbb{Z}_2$ symmetries to explain the anomalies in the measured
anomalous magnetic dipole moments of muon and electron, $(g-2)_{\mu,e}$, while
simultaneously accommodating a dark matter candidate. These new symmetries are
introduced not only to avoid the dangerous lepton flavor-violating decays of
charged leptons, but also to ensure the stability of the dark matter. Our
models can realize the opposite-sign contributions to the muon and electron
$g-2$ via one-loop diagrams involving new vector-like leptons. Under the vacuum
stability and perturbative unitarity bounds as well as the constraints from the
dark matter direct searches and related LHC data, we find suitable parameter
space to simultaneously explain $(g-2)_{\mu,e}$ and the relic density. In this
parameter space, the coupling of the Higgs boson with muons can be enhanced by
up to $\sim 38\%$ from its Standard Model value, which can be tested in future
collider experiments.
