In a groundbreaking effort to close the wage gap between men and women, Massachusetts has become the first state to bar employers from asking about applicants’ salaries before offering them a job. The new law will require hiring managers to state a compensation figure upfront — based on what an applicant’s worth is to the company, rather than on what he or she made in a previous position. The bipartisan legislation is being pushed as a model for other states, as the issue of men historically out-earning women who do the same job has leapt onto the national political scene. Nationally, there have been repeated efforts to strengthen equal pay laws — which are already on the books but tend to lack teeth — but none have succeeded so far. Massachusetts joins at least 12 other states that already require companies to let employees compare notes about how much they are paid.