LoginSignup
4
5

More than 5 years have passed since last update.

PhalconのVoltでAngularJSのタグを使う

Last updated at Posted at 2015-05-18

PhalconのVoltとAngularJSのタグが両方とも{{}}なので困りました。

解決策としては、とりあえず以下のいずれかの方法かと思います。

AngularJSのタグを[[]]に変更する

var ngModule = angular.module('HHF', ['ngResource', 'ui'])
    .config(function($interpolateProvider) {
        $interpolateProvider.startSymbol('[[');
        $interpolateProvider.endSymbol(']]');
    })
);

VoltでAngularJSタグ出力用関数を作る

{{ng("Model.prop")}}でAngularJSのタグを出力

service.php
// DIにviewをセットするところ
$volt->getCompiler()->addFunction('ng', function($input) {
  return '"{{".' . $input . '."}}"';
});
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5