我最近開始學習Angularjs
,並且在執行materializecss
tooltip
時出現角度範圍時卡住了。Materialisecss工具提示不能與Angularjs一起工作
HTML
<div class="color-picker">
<div class="item" ng-repeat="color in colors">
<div class="color tooltipped" data-position="bottom" data-tooltip="color.colorName" ng-style="{'background-color': color.hexValue}"></div>
</div>
</div>
這裏是彩色數據:
app.controller('mainController', ['$scope', function($scope){
$scope.colors =
[
{
colorName: "red",
hexValue: "#f00"
},
{
colorName: "green",
hexValue: "#0f0"
},
{
colorName: "blue",
hexValue: "#00f"
},
{
colorName: "cyan",
hexValue: "#0ff"
},
{
colorName: "magenta",
hexValue: "#f0f"
},
{
colorName: "yellow",
hexValue: "#ff0"
},
{
colorName: "black",
hexValue: "#000"
},
{
colorName: "white",
hexValue: "#fff"
}
]
}]);
我已經成功地顯示出不同的顏色,但未能表現出與colorName和tooltip
我不想使用如果可能,請使用angular-materialize
等額外插件。多謝你們。
編輯
對不起,這裏是我的JS文件:
<script src="js/jquery-1.11.2.min.js"></script>
<script src="js/materialize.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/angular.min.js"></script>
<script src="js/app.js"></script>
<script src="js/main-controller.js"></script>
你鏈接了'jquery'和'materialize.js'文件嗎? –
@TirthPatel似乎是這樣的,我不知道我是否應該將materialize.js放在angular.js的下方 – RyJ