我在范围属性定义中看到了一些使用问号('?')的指令,如下所示:
app.directive('userInfo', function() {
return {
restrict: 'A',
scope: {prop: '=?'},
templateUrl: 'some/template/url',
};
我找了它,我看到的唯一想法就是: '=?'是什么意思?在angularJS指令中隔离范围声明?。但它没有按照他在那里解释的方式工作。我已成功运行我的应用程序,并没有抛出异常。
有人可以详细说明一下吗?