Questions tagged «polymer»

10
Polymer元素和AngularJS指令之间有什么区别?
在“聚合物入门”页面上,我们看到了一个正在使用的聚合物示例: <html> <head> <!-- 1. Shim missing platform features --> <script src="polymer-all/platform/platform.js"></script> <!-- 2. Load a component --> <link rel="import" href="x-foo.html"> </head> <body> <!-- 3. Declare the component by its tag. --> <x-foo></x-foo> </body> </html> 您会注意到<x-foo></x-foo>,由platform.js和定义x-foo.html。 看起来这等效于AngularJS中的指令模块: angular.module('xfoo', []) .controller('X-Foo', ['$scope',function($scope) { $scope.text = 'hey hey!'; }) .directive('x-foo', function() { …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.