。如何使用underscore.strings與我有麻煩underscore.strings與AngularJS工作AngularJs
各地underscore.strings的文檔始終顯示與我不認爲是適當的AngularJS requireJs例子。
我不能與任何這些statments的訪問字符串函數,我有點困惑於如何我應該沒有requirejs初始化underscore.strings
<script src="/bower_components/underscore/underscore.js"></script>
<script src="/bower_components/underscore.string/dist/underscore.string.js"></script>
<script type="text/javascript">
$(document).ready(function() {
try {
console.log(_); // Returns a reference to Underscore
} catch (e) {
console.log(e);
}
try {
console.log(_s); // Undefined
} catch (e) {
console.log(e);
}
try {
console.log(_.str); // Undefined
} catch (e) {
console.log(e);
}
try {
console.log(_.string); // Undefined
} catch (e) {
console.log(e);
}
});
</script>
強調你能給身邊你如何與underscore.string使用它的一些清晰?我已經能夠得到undescore.js工作正常,我也用這個角度下劃線連接器https://github.com/andresesfm/angular-underscore-module。我真的不明白,您對例子,如何允許我使用underscore.string? – 2015-03-19 01:59:41
工作了,DCMarkie的答案是什麼,我一直在尋找 – 2015-03-19 02:09:05