Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 组件绑定行为奇怪_Angularjs - Fatal编程技术网

Angularjs 组件绑定行为奇怪

Angularjs 组件绑定行为奇怪,angularjs,Angularjs,我正在尝试学习如何使用组件绑定功能。 所以我写了一个组件: 'use strict'; var module = angular.module("Test", []); module.controller("Controller2", Controller2); module.component("compo2", { controller: "Controller2", bindings: { url: "@", thing: "<"

我正在尝试学习如何使用组件绑定功能。 所以我写了一个组件:

'use strict';
var module = angular.module("Test", []);

module.controller("Controller2", Controller2);
module.component("compo2", {
    controller: "Controller2",
    bindings: {
        url: "@",
        thing: "<"
    }
});


Controller2.$inject = ["$scope"];
function Controller2($scope) {
    var self = this;
    this.$onInit = function () {
    }  
}
“严格使用”;
变量模块=角度模块(“测试”,[]);
控制器模块(“控制器2”,控制器2);
组件(“compo2”{
控制器:“控制器2”,
绑定:{
网址:“@”,
事情:“如果你想使用
试试
thing=“'a911'”
<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="./Test/angular.js"></script>
    <script src="./compoTest.js"></script>
</head>
<body ng-app="Test">
        <compo2 url="www.test.com" thing="a911"> T.E.S.T </compo2>
</body>
</html>
<compo2 url="www.test.com" thing="vm.myString"> T.E.S.T </compo2>