它是可能做这样的工作没有一个适当的控制器,但我会劝阻它。这就是说,我继续得到它反正工作:
<p class="text-justify last-body" ng-app>
This growing collection of studies, curated by
<a ng-init="imgsrc={
src: 'http://wallpaper-gallery.net/images/pig-images/pig-images-12.jpg',
show: false,
};">
<span ng-mouseover="imgsrc.show = true" ng-mouseout="imgsrc.show = false">
Yours Truly
</span>
<img ng-src="{{ imgsrc.src }}" ng-show="imgsrc.show" />
</a>,
is focused primarily
on studies dealing with eh tohp ah key pig*. As a fan of mooshoo and aigeiaig, I'm open to
working with any dataset ranging from yakdkat studies to lakuktauka. If you would like
to submit a study for publishing, or if you have any questions about a particular study,
please feel free to <a href="/contact">Contact Me.</a> Thank you for visiting, and happy wamotiem!
</p>
这将显示图像,当你将鼠标悬停在“此致”,并隐藏图像,当你移动鼠标了。阻止你的例子工作的主要原因是缺少来自最顶层元素的ng-app
指令。除此之外,我还清理了一些逻辑,以便更容易理解发生了什么。
这里是一个JSFiddle,如果你想看到它的行动:https://jsfiddle.net/kv4qvu3w/2/