我想知道如何在ngOnInit()
中使用原始HTML标记。例如,通常我可以使用类似的东西:
element.whateverIwant + '<br>';
但是当我在ngOnInit()
内使用<br>
时,Users/macuser/Desktop/Freelance1/config/application.rb:18:in `initialize': No such file or directory @ rb_sysopen - /Users/macuser/Desktop/Freelance1/config/local_env.yml (Errno::ENOENT)
from /Users/macuser/Desktop/Freelance1/config/application.rb:18:in `open'
from /Users/macuser/Desktop/Freelance1/config/application.rb:18:in `block in <class:Application>'
from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support/lazy_load_hooks.rb:43:in `execute_hook'
from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support/lazy_load_hooks.rb:35:in `block in on_load'
from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support/lazy_load_hooks.rb:34:in `each'
from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.3/lib/active_support/lazy_load_hooks.rb:34:in `on_load'
from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.3/lib/rails/railtie/configuration.rb:53:in `before_configuration'
from /Users/macuser/Desktop/Freelance1/config/application.rb:16:in `<class:Application>'
from /Users/macuser/Desktop/Freelance1/config/application.rb:10:in `<module:SSS>'
from /Users/macuser/Desktop/Freelance1/config/application.rb:9:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:129:in `require'
from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:129:in `block in perform'
from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in `tap'
from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in `perform'
from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.3/lib/rails/command/base.rb:63:in `perform'
from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.3/lib/rails/command.rb:44:in `invoke'
from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.1.3/lib/rails/commands.rb:16:in `<top (required)>'
from /Users/macuser/Desktop/Freelance1/bin/rails:9:in `require'
from /Users/macuser/Desktop/Freelance1/bin/rails:9:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
from /usr/local/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
from /usr/local/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
from /usr/local/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
from /usr/local/lib/ruby/gems/2.4.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
from /usr/local/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
from /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/macuser/Desktop/Freelance1/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
变为普通文字。